msvcrt: Support z length modifier in scanf.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2021-09-20 20:51:32 +02:00 committed by Alexandre Julliard
parent 6049cc8613
commit 5d5f11c002
2 changed files with 12 additions and 0 deletions

View File

@ -281,6 +281,11 @@ _FUNCTION_ {
format += 2;
}
break;
#if _MSVCR_VER == 0 || _MSVCR_VER >= 140
case 'z':
if (sizeof(void *) == sizeof(LONGLONG)) I64_prefix = 1;
break;
#endif
default:
prefix_finished = 1;
}

View File

@ -48,6 +48,7 @@ static void test_sscanf(void)
float ret_float1, ret_float2;
double double_res;
unsigned int i;
size_t ret_size;
static const unsigned int tests[] =
{
@ -289,6 +290,12 @@ static void test_sscanf(void)
ret = vsscanf_wrapper(tests[i], "infi", -1, "%lf%n", &double_res, &count);
ok(ret == -1, "sscanf returned %d for flags %#x\n", ret, tests[i]);
ret_size = ~0;
ret = vsscanf_wrapper(tests[i], "1", -1, "%zd", &ret_size);
ok(ret == 1, "sscanf returned %d for flags %#x\n", ret, tests[i]);
ok(ret_size == 1, "got wrong size_t %s for flags %#x\n",
wine_dbgstr_longlong((LONGLONG)ret_size), tests[i]);
}
}