Commit 5c631168 authored by Jesse Allen's avatar Jesse Allen Committed by Alexandre Julliard

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

parent d5739ed8
......@@ -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");
......
......@@ -347,19 +347,17 @@ static inline int pf_output_format_A( pf_output *out, LPCSTR str,
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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment