[CRT]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Tue, 22 Feb 2011 17:29:32 +0000 (17:29 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Tue, 22 Feb 2011 17:29:32 +0000 (17:29 +0000)
Fix special behaviour of wsprintf: when used with # flag, the "0x" prefix does not count into the field width, so we have to add additional 2 characters here. Fixes Opera installer.
See issue #5900 for more details.

svn path=/trunk/; revision=50866

reactos/lib/sdk/crt/printf/streamout.c

index c1f654f..8e9ce4f 100644 (file)
@@ -587,6 +587,9 @@ streamout(FILE *stream, const TCHAR *format, va_list argptr)
                 if (flags & FLAG_SPECIAL)
                 {
                     prefix = &digits[16];
+#ifdef _USER32_WSPRINTF
+                    fieldwidth += 2;
+#endif
                 }
 
             case _T('u'):