Commit 287dabd9 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Fix floating point numbers scanning when null-byte is preceding the number.

parent 0aaaacd1
......@@ -393,6 +393,8 @@ _FUNCTION_ {
/* skip initial whitespace */
while ((nch!=_EOF_) && _ISSPACE_(nch))
nch = _GETC_(file);
if (nch == _EOF_)
break;
ctx.unget = nch;
#ifdef STRING
ctx.file = file;
......
......@@ -165,6 +165,12 @@ static void test_sscanf( void )
ok(double_res >= 1.1e-30-1e-45 && double_res <= 1.1e-30+1e-45,
"Got %.18le, expected %.18le\n", double_res, 1.1e-30);
buffer[0] = 0;
double_res = 1;
ret = p_sscanf(buffer, "%lf", &double_res);
ok(ret == -1, "expected 0, got %u\n", ret);
ok(double_res == 1, "Got %lf, expected 1\n", double_res);
/* check strings */
ret = p_sprintf(buffer," %s", pname);
ok( ret == 26, "expected 26, got %u\n", ret);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment