From: Paul Gofman pgofman@codeweavers.com
--- dlls/shlwapi/tests/string.c | 2 ++ dlls/shlwapi/wsprintf.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/shlwapi/tests/string.c b/dlls/shlwapi/tests/string.c index ab9b305f032..85b5c653fa1 100644 --- a/dlls/shlwapi/tests/string.c +++ b/dlls/shlwapi/tests/string.c @@ -1714,6 +1714,8 @@ static void test_printf_format(void) { "%hhu", sizeof(ULONG), "10", NULL, 10 }, { "%hwu", sizeof(ULONG), "10", NULL, 10 }, { "%whu", sizeof(ULONG), "10", NULL, 10 }, + { "%##lhllwlx", sizeof(ULONG64), "0x1000000010", NULL, 0x1000000010 }, + { "%##lhlwlx", sizeof(ULONG), "0x10", NULL, 0x1000000010 }, { "%04lhlwllx", sizeof(ULONG64), "1000000010", NULL, 0x1000000010 }, { "%s", sizeof(ULONG_PTR), "str", NULL, (ULONG_PTR)"str", L"str" }, { "%S", sizeof(ULONG_PTR), "str", NULL, (ULONG_PTR)L"str", "str" }, diff --git a/dlls/shlwapi/wsprintf.c b/dlls/shlwapi/wsprintf.c index b4113d2d563..abf217e9474 100644 --- a/dlls/shlwapi/wsprintf.c +++ b/dlls/shlwapi/wsprintf.c @@ -95,7 +95,7 @@ static INT WPRINTF_ParseFormatA( LPCSTR format, WPRINTF_FORMAT *res ) res->width = 0; res->precision = 0; if (*p == '-') { res->flags |= WPRINTF_LEFTALIGN; p++; } - if (*p == '#') { res->flags |= WPRINTF_PREFIX_HEX; p++; } + while (*p == '#') { res->flags |= WPRINTF_PREFIX_HEX; p++; } while (*p == ' ') ++p; if (*p == '0') { res->flags |= WPRINTF_ZEROPAD; p++; } while ((*p >= '0') && (*p <= '9')) /* width field */ @@ -192,7 +192,7 @@ static INT WPRINTF_ParseFormatW( LPCWSTR format, WPRINTF_FORMAT *res ) res->width = 0; res->precision = 0; if (*p == '-') { res->flags |= WPRINTF_LEFTALIGN; p++; } - if (*p == '#') { res->flags |= WPRINTF_PREFIX_HEX; p++; } + while (*p == '#') { res->flags |= WPRINTF_PREFIX_HEX; p++; } while (*p == ' ') ++p; if (*p == '0') { res->flags |= WPRINTF_ZEROPAD; p++; } while ((*p >= '0') && (*p <= '9')) /* width field */