Commit 32bb8d90 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Fix handling of unsigned chars in scanf format.

parent a8389a2b
......@@ -699,7 +699,7 @@ _FUNCTION_ {
* a matching non-white-space character. */
else {
/* check for character match */
if (nch == *format) {
if (nch == (unsigned char)*format) {
nch = _GETC_(file);
} else break;
}
......
......@@ -251,6 +251,10 @@ static void test_sscanf( void )
ok(ret == 2, "got %d\n", ret);
ok(!strcmp(buffer, "test"), "buf %s\n", buffer);
ok(!strcmp(buffer1, "value\xda"), "buf %s\n", buffer1);
ret = sscanf("\x81test", "\x81%s", buffer);
ok(ret == 1, "got %d\n", ret);
ok(!strcmp(buffer, "test"), "buf = %s\n", buffer);
}
static void test_sscanf_s(void)
......
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