From 38c0da9978b9e268886b1a23aa9b84f4e3254c30 Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Tue, 14 Feb 2023 20:54:53 +0900 Subject: [PATCH] [CRT] printf/wprintf: Support %zu (#5056) "%zu" is a printf format specifier for type size_t. Some apps assume the implementation of this specifier. CORE-17787 --- sdk/lib/crt/printf/streamout.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/lib/crt/printf/streamout.c b/sdk/lib/crt/printf/streamout.c index 2886ad63d13..36bc7a31182 100644 --- a/sdk/lib/crt/printf/streamout.c +++ b/sdk/lib/crt/printf/streamout.c @@ -432,6 +432,10 @@ streamout(FILE *stream, const TCHAR *format, va_list argptr) else if (chr == _T('w')) flags |= FLAG_WIDECHAR; else if (chr == _T('L')) flags |= 0; // FIXME: long double else if (chr == _T('F')) flags |= 0; // FIXME: what is that? + else if (chr == _T('z') && *format && strchr("udxXion", *format)) + { + flags |= FLAG_INTPTR; + } else if (chr == _T('l')) { /* Check if this is the 2nd 'l' in a row */