From: Trung Nguyen <24154-trungnt2910@users.noreply.gitlab.winehq.org> - /dlls/msvcrt/tests/printf.c - /dlls/msvcrt/printf.h --- dlls/msvcrt/printf.h | 5 ++++- dlls/msvcrt/tests/printf.c | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dlls/msvcrt/printf.h b/dlls/msvcrt/printf.h index 34af93b4569..dbc93962169 100644 --- a/dlls/msvcrt/printf.h +++ b/dlls/msvcrt/printf.h @@ -279,7 +279,10 @@ static inline int FUNC_NAME(pf_handle_string)(FUNC_NAME(puts_clbk) pf_puts, void if((flags->NaturalString && !api_is_wide) || flags->IntegerLength == LEN_SHORT) return FUNC_NAME(pf_output_format_str)(pf_puts, puts_ctx, str, len, flags, locale); - if((flags->Format=='S' || flags->Format=='C' || flags->Format=='Z') == complement_is_narrow) + if(flags->Format=='Z') + return FUNC_NAME(pf_output_format_str)(pf_puts, puts_ctx, str, len, flags, locale); + + if((flags->Format=='S' || flags->Format=='C') == complement_is_narrow) return FUNC_NAME(pf_output_format_str)(pf_puts, puts_ctx, str, len, flags, locale); else return FUNC_NAME(pf_output_format_wstr)(pf_puts, puts_ctx, str, len, flags, locale); diff --git a/dlls/msvcrt/tests/printf.c b/dlls/msvcrt/tests/printf.c index 37160c707b2..4bc399fb675 100644 --- a/dlls/msvcrt/tests/printf.c +++ b/dlls/msvcrt/tests/printf.c @@ -171,7 +171,7 @@ static void test_sprintf( void ) { "% d", " 1", 0, INT_ARG, 1 }, { "%+ d", "+1", 0, INT_ARG, 1 }, { "%S", "wide", 0, PTR_ARG, 0, 0, 0, L"wide" }, - { "%Z", "wide", 0, PTR_ARG, 0, 0, 0, &(UNICODE_STRING){ 8, 8, (wchar_t *)L"wide" } }, + { "%Z", "ansi", 0, PTR_ARG, 0, 0, 0, &(ANSI_STRING){ 4, 4, (char *)"ansi" } }, { "%04c", "0001", 0, INT_ARG, '1' }, { "%-04c", "1 ", 0, INT_ARG, '1' }, { "%#012x", "0x0000000001", 0, INT_ARG, 1 }, @@ -220,9 +220,9 @@ static void test_sprintf( void ) { "%s", "(null)", 0, PTR_ARG, 0, 0, 0, NULL }, { "%s", "%%%%", 0, PTR_ARG, 0, 0, 0, "%%%%" }, { "%Z", "(null)", 0, PTR_ARG, 0, 0, 0, NULL }, - { "%Z", "(null)", 0, PTR_ARG, 0, 0, 0, &(UNICODE_STRING){ 0, 0, NULL } }, - { "%Z", "(null)", 0, PTR_ARG, 0, 0, 0, &(UNICODE_STRING){ 2, 2, NULL } }, - { "%Z", "wi", 0, PTR_ARG, 0, 0, 0, &(UNICODE_STRING){ 4, 8, (wchar_t *)L"wide" } }, + { "%Z", "(null)", 0, PTR_ARG, 0, 0, 0, &(ANSI_STRING){ 0, 0, NULL } }, + { "%Z", "(null)", 0, PTR_ARG, 0, 0, 0, &(ANSI_STRING){ 1, 1, NULL } }, + { "%Z", "wi", 0, PTR_ARG, 0, 0, 0, &(ANSI_STRING){ 2, 4, (char *)"wide" } }, { "%u", "4294967295", 0, INT_ARG, -1 }, { "%w", "", 0, INT_ARG, -1 }, { "%h", "", 0, INT_ARG, -1 }, -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10460