From 1309e11ea1c5863616de7638731d00d6ab90b295 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Sat, 2 Nov 2019 14:39:23 +0100 Subject: [PATCH] msvcrt: Improve printf %I format support. Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/msvcrt/printf.h | 6 +++--- dlls/msvcrt/tests/printf.c | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/msvcrt/printf.h b/dlls/msvcrt/printf.h index 975977087d0..20bd77e7920 100644 --- a/dlls/msvcrt/printf.h +++ b/dlls/msvcrt/printf.h @@ -509,10 +509,10 @@ int FUNC_NAME(pf_printf)(FUNC_NAME(puts_clbk) pf_puts, void *puts_ctx, const API p += 3; } else if(*(p+1)=='3' && *(p+2)=='2') p += 3; - else if(isdigit(*(p+1)) || !*(p+1)) - break; - else + else if(p[1] && strchr("diouxX", p[1])) flags.IntegerNative = *p++; + else + break; } else if(*p == 'w') flags.WideString = *p++; #if _MSVCR_VER >= 140 diff --git a/dlls/msvcrt/tests/printf.c b/dlls/msvcrt/tests/printf.c index ac5c37a59cb..d1fe292143b 100644 --- a/dlls/msvcrt/tests/printf.c +++ b/dlls/msvcrt/tests/printf.c @@ -159,6 +159,8 @@ static void test_sprintf( void ) " 00000000000000000000000000000000000000000000000000000000000000000000000000000001", 0, INT_ARG, 1 }, { "%I", "I", 0, INT_ARG, 1 }, + { "%Iq", "Iq", 0, INT_ARG, 1 }, + { "%Ihd", "Ihd", 0, INT_ARG, 1 }, { "%I0d", "I0d", 0, INT_ARG, 1 }, { "%I64D", "D", 0, ULONGLONG_ARG, 0, -1 }, { "%zx", "1", "zx", TODO_FLAG | INT_ARG, 1 }, @@ -256,6 +258,7 @@ static void test_sprintf( void ) int i, x, r; for (i=0; i