Commit 5def7dd3 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Handle %ls in sprintf.

parent bf6d5fc6
...@@ -131,6 +131,16 @@ static void test_sprintf( void ) ...@@ -131,6 +131,16 @@ static void test_sprintf( void )
ok(!strcmp(buffer,"-s"), "failed\n"); ok(!strcmp(buffer,"-s"), "failed\n");
ok( r==2, "return count wrong\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"; format = "%b";
r = sprintf(buffer, format); r = sprintf(buffer, format);
ok(!strcmp(buffer,"b"), "failed\n"); ok(!strcmp(buffer,"b"), "failed\n");
......
...@@ -501,7 +501,7 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, va_list valist ) ...@@ -501,7 +501,7 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, va_list valist )
r = 0; r = 0;
/* output a unicode string */ /* 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' ) ||
( out->unicode && flags.Format == 's' ) ) ( out->unicode && flags.Format == 's' ) )
{ {
......
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