msvcrt: Fix handling of unsigned chars in scanf format.
Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
a8389a2b58
commit
32bb8d9068
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue