ntdll: Ignore L length specifier in printf.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2020-07-14 15:33:24 +02:00 committed by Alexandre Julliard
parent 859766698c
commit a6fb7be678
2 changed files with 13 additions and 1 deletions

View file

@ -375,11 +375,15 @@ static int FUNC_NAME(pf_vsnprintf)( FUNC_NAME(pf_output) *out, const APICHAR *fo
flags.IntegerDouble = TRUE;
p += 2;
}
else if( *p == 'l' || *p == 'L' )
else if( *p == 'l' )
{
flags.IntegerLength = LEN_LONG;
p++;
}
else if( *p == 'L' )
{
p++;
}
else if( *p == 'h')
{
flags.IntegerLength = LEN_SHORT;

View file

@ -1529,6 +1529,14 @@ static void test__snprintf(void)
ok(!memcmp(buffer, "tes", 3), "buf = %s\n", buffer);
ok(buffer[3] == 0x7c, "buffer[3] = %x\n", buffer[3]);
res = p_snprintf(buffer, sizeof(buffer), "%ls", L"test");
ok(res == strlen(buffer), "wrong size %d\n", res);
ok(!strcmp(buffer, "test"), "got %s\n", debugstr_a(buffer));
res = p_snprintf(buffer, sizeof(buffer), "%Ls", "test");
ok(res == strlen(buffer), "wrong size %d\n", res);
ok(!strcmp(buffer, "test"), "got %s\n", debugstr_a(buffer));
res = p_snprintf(buffer, sizeof(buffer), "%I64x %d", (ULONGLONG)0x1234567890, 1);
ok(res == strlen(buffer), "wrong size %d\n", res);
ok(!strcmp(buffer, "1234567890 1"), "got %s\n", debugstr_a(buffer));