https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6388b91a4d2dcdcd82493…
commit 6388b91a4d2dcdcd82493219e7bf82d94121a15f
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Fri Apr 5 16:33:18 2019 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Fri Apr 5 16:33:18 2019 +0900
[CRT][USER32] fix wsprintf additional argument (%*s) (#1470)
Reduce wsprintf function failures ("%*s"). CORE-13955
---
sdk/lib/crt/printf/streamout.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/sdk/lib/crt/printf/streamout.c b/sdk/lib/crt/printf/streamout.c
index f427c84f28..2886ad63d1 100644
--- a/sdk/lib/crt/printf/streamout.c
+++ b/sdk/lib/crt/printf/streamout.c
@@ -3,7 +3,8 @@
* PROJECT: ReactOS crt library
* FILE: lib/sdk/crt/printf/streamout.c
* PURPOSE: Implementation of streamout
- * PROGRAMMER: Timo Kreuzer
+ * PROGRAMMERS: Timo Kreuzer
+ * Katayama Hirofumi MZ
*/
#include <stdio.h>
@@ -372,6 +373,11 @@ streamout(FILE *stream, const TCHAR *format, va_list argptr)
/* Handle field width modifier */
if (chr == _T('*'))
{
+#ifdef _USER32_WSPRINTF
+ if ((written = streamout_char(stream, chr)) == 0) return -1;
+ written_all += written;
+ continue;
+#else
fieldwidth = va_arg(argptr, int);
if (fieldwidth < 0)
{
@@ -379,6 +385,7 @@ streamout(FILE *stream, const TCHAR *format, va_list argptr)
fieldwidth = -fieldwidth;
}
chr = *format++;
+#endif
}
else
{
@@ -397,8 +404,14 @@ streamout(FILE *stream, const TCHAR *format, va_list argptr)
if (chr == _T('*'))
{
+#ifdef _USER32_WSPRINTF
+ if ((written = streamout_char(stream, chr)) == 0) return -1;
+ written_all += written;
+ continue;
+#else
precision = va_arg(argptr, int);
chr = *format++;
+#endif
}
else
{