msvcrt: Parse I, I32, and I64 integer size flags in printf.

This commit is contained in:
Jesse Allen 2005-12-26 13:00:01 +01:00 committed by Alexandre Julliard
parent 81c446ef5d
commit 6c70942a05
2 changed files with 29 additions and 0 deletions

View File

@ -56,6 +56,21 @@ static void test_sprintf( void )
ok(!strcmp(buffer, "I"), "Problem with \"I\" interpretation\n");
ok( r==1, "return count wrong\n");
format = "%I0d";
r = sprintf(buffer,format,1);
ok(!strcmp(buffer,"I0d"),"I0d failed\n");
ok( r==3, "return count wrong\n");
format = "%I32d";
r = sprintf(buffer,format,1);
ok(!strcmp(buffer,"1"),"I32d failed\n");
ok( r==1, "return count wrong\n");
format = "%I64D";
r = sprintf(buffer,format,(LONGLONG)-1);
ok(!strcmp(buffer,"D"),"I64D failed: %s\n",buffer);
ok( r==1, "return count wrong\n");
format = "% d";
r = sprintf(buffer,format,1);
ok(!strcmp(buffer, " 1"),"Problem with sign place-holder: '%s'\n",buffer);

View File

@ -495,6 +495,20 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, va_list valist )
flags.IntegerLength = *p;
p++;
}
else if( *p == 'I' )
{
if( *(p+1) == '6' && *(p+2) == '4' )
{
flags.IntegerDouble++;
p += 3;
}
else if( *(p+1) == '3' && *(p+2) == '2' )
p += 3;
else if( isdigit(*(p+1)) || *(p+1) == 0 )
break;
else
p++;
}
else if( *p == 'w' )
flags.WideString = *p++;
else if( *p == 'F' )