Handle %ls in sprintf.

oldstable
Mike McCormack 2005-03-05 10:46:46 +00:00 committed by Alexandre Julliard
parent bf6d5fc66b
commit 5def7dd337
2 changed files with 11 additions and 1 deletions

View File

@ -131,6 +131,16 @@ static void test_sprintf( void )
ok(!strcmp(buffer,"-s"), "failed\n");
ok( r==2, "return count wrong\n");
format = "%ls";
r = sprintf(buffer, format, wide );
ok(!strcmp(buffer,"wide"), "failed\n");
ok( r==4, "return count wrong\n");
format = "%Ls";
r = sprintf(buffer, format, "not wide" );
ok(!strcmp(buffer,"not wide"), "failed\n");
ok( r==8, "return count wrong\n");
format = "%b";
r = sprintf(buffer, format);
ok(!strcmp(buffer,"b"), "failed\n");

View File

@ -501,7 +501,7 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, va_list valist )
r = 0;
/* output a unicode string */
if( ( flags.Format == 's' && flags.WideString ) ||
if( ( flags.Format == 's' && (flags.WideString || flags.IntegerLength == 'l' )) ||
( !out->unicode && flags.Format == 'S' ) ||
( out->unicode && flags.Format == 's' ) )
{