From: Paul Gofman pgofman@codeweavers.com
--- dlls/ntdll/printf.h | 2 +- dlls/ntdll/tests/string.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/printf.h b/dlls/ntdll/printf.h index 4fad5c0ddec..b7dba6594a5 100644 --- a/dlls/ntdll/printf.h +++ b/dlls/ntdll/printf.h @@ -446,7 +446,7 @@ static int FUNC_NAME(pf_vsnprintf)( FUNC_NAME(pf_output) *out, const APICHAR *fo /* output a single character */ else if( flags.Format == 'c' || flags.Format == 'C' ) { - APICHAR ch = (APICHAR)va_arg( valist, int ); + wchar_t ch = (wchar_t)va_arg( valist, int ); r = FUNC_NAME(pf_handle_string_format)( out, &ch, 1, &flags, (flags.Format == 'C') ); }
diff --git a/dlls/ntdll/tests/string.c b/dlls/ntdll/tests/string.c index aad42be7a82..6454720b645 100644 --- a/dlls/ntdll/tests/string.c +++ b/dlls/ntdll/tests/string.c @@ -1870,11 +1870,22 @@ static void test_printf_format(void) { "%wwws", sizeof(ULONG_PTR), "str", NULL, (ULONG_PTR)L"str" }, { "%wwwS", sizeof(ULONG_PTR), "str", NULL, (ULONG_PTR)L"str" }, { "%c", sizeof(SHORT), "\xc8", L"\x95c8", 0x95c8 }, + { "%lc", sizeof(SHORT), "\x3f", L"\x95c8", 0x95c8 }, { "%llc", sizeof(SHORT), "\xc8", L"\x95c8", 0x95c8 }, + { "%lllc", sizeof(SHORT), "\x3f", L"\x95c8", 0x95c8 }, { "%llllc", sizeof(SHORT), "\xc8", L"\x95c8", 0x95c8 }, + { "%lllllc", sizeof(SHORT), "\x3f", L"\x95c8", 0x95c8 }, + { "%C", sizeof(SHORT), "\x3f", L"\xc8", 0x95c8 }, + { "%lC", sizeof(SHORT), "\x3f", L"\x95c8", 0x95c8 }, + { "%llC", sizeof(SHORT), "\x3f", L"\xc8", 0x95c8 }, + { "%lllC", sizeof(SHORT), "\x3f", L"\x95c8", 0x95c8 }, + { "%llllC", sizeof(SHORT), "\x3f", L"\xc8", 0x95c8 }, + { "%lllllC", sizeof(SHORT), "\x3f", L"\x95c8", 0x95c8 }, { "%hc", sizeof(BYTE), "\xc8", L"\xc8", 0x95c8 }, { "%hhc", sizeof(BYTE), "\xc8", L"\xc8", 0x95c8 }, { "%hhhc", sizeof(BYTE), "\xc8", L"\xc8", 0x95c8 }, + { "%wc", sizeof(BYTE), "\x3f", L"\x95c8", 0x95c8 }, + { "%wC", sizeof(BYTE), "\x3f", L"\x95c8", 0x95c8 }, { "%I64u", sizeof(ULONG64), "10", NULL, 10 }, { "%llI64u", sizeof(ULONG64), "10", NULL, 10 }, { "%I64llu", sizeof(ULONG64), "10", NULL, 10 },