msvcrt: Ignore PadZero when LeftAlign is true in printf conversions.
This commit is contained in:
parent
9a95aa7da2
commit
39b725b799
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue