ucrtbase: Write the %hh prefix as a single char.

This fixes a crash in Planet Coaster on startup.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-06-10 20:19:50 -04:00 committed by Alexandre Julliard
parent 353ea070f3
commit 9445bed298
2 changed files with 4 additions and 1 deletions

View File

@ -309,6 +309,9 @@ _FUNCTION_ {
if (I64_prefix) _SET_NUMBER_(LONGLONG);
else if (l_prefix) _SET_NUMBER_(LONG);
else if (h_prefix == 1) _SET_NUMBER_(short int);
#if _MSVCR_VER >= 140
else if (h_prefix == 2) _SET_NUMBER_(char);
#endif
else _SET_NUMBER_(int);
}
}

View File

@ -188,7 +188,7 @@ static void test_sscanf(void)
result = 0xdeadbeef;
ret = vsscanf_wrapper(tests[i], "12345678", "%hhd", &result);
ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]);
todo_wine ok(result == 0xdeadbe4e, "got wrong number %#x for flags %#x\n", result, tests[i]);
ok(result == 0xdeadbe4e, "got wrong number %#x for flags %#x\n", result, tests[i]);
ret = vsscanf_wrapper(tests[i], "12345678901234", "%lld", &result64);
ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]);