msvcrt patch 2

Ove Kaaven ovehk at ping.uio.no
Sun Apr 15 10:30:38 CDT 2001


One game did something like wsprintf(buf,"...%f...",double_val), which
doesn't work in the current msvcrt/ntdll implementation. This hack fixes
the issue for this particular case, but whoever wrote this code should be
LARTed into writing a proper fix (this hack doesn't handle %lf, for
example).

Log, if included:
Ove Kaaven <ovek at transgaming.com>
Handle the %f case in wsprintf.

Index: wine/dlls/msvcrt/wcs.c
diff -u wine/dlls/msvcrt/wcs.c:1.1.1.4 wine/dlls/msvcrt/wcs.c:1.3
--- wine/dlls/msvcrt/wcs.c:1.1.1.4	Sat Apr 14 18:49:46 2001
+++ wine/dlls/msvcrt/wcs.c	Sat Apr 14 19:20:30 2001
@@ -201,7 +201,10 @@
           {
             *fmta++ = *iter;
             *fmta = '\0';
-            sprintf(bufaiter, fmtbufa, va_arg(valist, void *));
+            if (*iter == (WCHAR)L'f')
+              sprintf(bufaiter, fmtbufa, va_arg(valist, double));
+            else
+              sprintf(bufaiter, fmtbufa, va_arg(valist, void *));
           }
           while (*bufaiter)
           {
Index: wine/dlls/ntdll/wcstring.c
diff -u wine/dlls/ntdll/wcstring.c:1.1.1.6 wine/dlls/ntdll/wcstring.c:1.2
--- wine/dlls/ntdll/wcstring.c:1.1.1.6	Fri Jan 26 11:14:29 2001
+++ wine/dlls/ntdll/wcstring.c	Sat Apr  7 06:39:28 2001
@@ -444,7 +444,10 @@
           {
             *fmta++ = *iter;
             *fmta = '\0';
-            sprintf(bufaiter, fmtbufa, va_arg(valist, void *));
+            if (*iter == (WCHAR)L'f')
+              sprintf(bufaiter, fmtbufa, va_arg(valist, double));
+            else
+              sprintf(bufaiter, fmtbufa, va_arg(valist, void *));
           }
           while (*bufaiter)
           {





More information about the wine-patches mailing list