Commit 39b725b7 authored by Jesse Allen's avatar Jesse Allen Committed by Alexandre Julliard

msvcrt: Ignore PadZero when LeftAlign is true in printf conversions.

parent 9a95aa7d
......@@ -66,6 +66,11 @@ static void test_sprintf( void )
ok(!strcmp(buffer,"0001"),"Character not zero-prefixed \"%s\"\n",buffer);
ok( r==4, "return count wrong\n");
format = "%-04c";
r = sprintf(buffer,format,'1');
ok(!strcmp(buffer,"1 "),"Character zero-padded and/or not left-adjusted \"%s\"\n",buffer);
ok( r==4, "return count wrong\n");
format = "%p";
r = sprintf(buffer,format,(void *)57);
ok(!strcmp(buffer,"00000039"),"Pointer formatted incorrectly \"%s\"\n",buffer);
......
......@@ -286,12 +286,11 @@ static inline int pf_fill( pf_output *out, int len, pf_flags *flags, char left )
int i, r = 0;
if( ( !left && flags->LeftAlign ) ||
( left && !flags->LeftAlign ) ||
( left && flags->PadZero ) )
( left && !flags->LeftAlign ))
{
for( i=0; (i<(flags->FieldLength-len)) && (r>=0); i++ )
{
if( flags->PadZero )
if( left && flags->PadZero )
r = pf_output_stringA( out, "0", 1 );
else
r = pf_output_stringA( out, " ", 1 );
......
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