Jesse Allen : msvcrt: Require exact uppercase and lowercase format in printf routines.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Dec 19 14:22:26 CST 2005


Module: wine
Branch: refs/heads/master
Commit: 5c6311688c13a5557e4b05d06f2f9b6f6c341063
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=5c6311688c13a5557e4b05d06f2f9b6f6c341063

Author: Jesse Allen <the3dfxdude at gmail.com>
Date:   Mon Dec 19 21:26:46 2005 +0100

msvcrt: Require exact uppercase and lowercase format in printf routines.

---

 dlls/msvcrt/tests/printf.c |    5 +++++
 dlls/msvcrt/wcs.c          |    6 ++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/dlls/msvcrt/tests/printf.c b/dlls/msvcrt/tests/printf.c
index 73b08b7..72b12a4 100644
--- a/dlls/msvcrt/tests/printf.c
+++ b/dlls/msvcrt/tests/printf.c
@@ -51,6 +51,11 @@ static void test_sprintf( void )
     ok(!strcmp(buffer, "1"), "Problem with \"ll\" interpretation\n");
     ok( r==1, "return count wrong\n");
 
+    format = "%I";
+    r = sprintf(buffer,format,1);
+    ok(!strcmp(buffer, "I"), "Problem with \"I\" interpretation\n");
+    ok( r==1, "return count wrong\n");
+
     format = "%S";
     r = sprintf(buffer,format,wide);
     ok(!strcmp(buffer,"wide"),"Problem with wide string format\n");
diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c
index 2e5d0a9..b8dc39e 100644
--- a/dlls/msvcrt/wcs.c
+++ b/dlls/msvcrt/wcs.c
@@ -347,19 +347,17 @@ static inline int pf_output_format_A( pf
 
 static inline BOOL pf_is_double_format( char fmt )
 {
-    char float_fmts[] = "aefg";
+    static const char float_fmts[] = "aeEfgG";
     if (!fmt)
         return FALSE;
-    fmt = tolower( fmt );
     return strchr( float_fmts, fmt ) ? TRUE : FALSE;
 }
 
 static inline BOOL pf_is_valid_format( char fmt )
 {
-    char float_fmts[] = "acdefginoux";
+    static const char float_fmts[] = "acCdeEfgGinouxX";
     if (!fmt)
         return FALSE;
-    fmt = tolower( fmt );
     return strchr( float_fmts, fmt ) ? TRUE : FALSE;
 }
 




More information about the wine-cvs mailing list