Commit 1d17e850 authored by Martin Storsjo's avatar Martin Storsjo Committed by Alexandre Julliard

msvcrt: Ignore 'N' as format length modifier for pointers, just like 'F'.

parent 1c8412d9
...@@ -461,7 +461,7 @@ int FUNC_NAME(pf_printf)(FUNC_NAME(puts_clbk) pf_puts, void *puts_ctx, const API ...@@ -461,7 +461,7 @@ int FUNC_NAME(pf_printf)(FUNC_NAME(puts_clbk) pf_puts, void *puts_ctx, const API
p++; p++;
} else if(*p == 'w') } else if(*p == 'w')
flags.WideString = *p++; flags.WideString = *p++;
else if(*p == 'F') else if(*p == 'F' || *p == 'N')
p++; /* ignore */ p++; /* ignore */
else else
break; break;
......
...@@ -413,6 +413,11 @@ static void test_sprintf( void ) ...@@ -413,6 +413,11 @@ static void test_sprintf( void )
ok(!strcmp(buffer,"0000000000000039"),"Pointer formatted incorrectly \"%s\"\n",buffer); ok(!strcmp(buffer,"0000000000000039"),"Pointer formatted incorrectly \"%s\"\n",buffer);
ok( r==16, "return count wrong\n"); ok( r==16, "return count wrong\n");
format = "%Np";
r = sprintf(buffer,format,(void *)57);
ok(!strcmp(buffer,"0000000000000039"),"Pointer formatted incorrectly \"%s\"\n",buffer);
ok( r==16, "return count wrong\n");
format = "%#-020p"; format = "%#-020p";
r = sprintf(buffer,format,(void *)57); r = sprintf(buffer,format,(void *)57);
ok(!strcmp(buffer,"0X0000000000000039 "),"Pointer formatted incorrectly\n"); ok(!strcmp(buffer,"0X0000000000000039 "),"Pointer formatted incorrectly\n");
...@@ -435,6 +440,11 @@ static void test_sprintf( void ) ...@@ -435,6 +440,11 @@ static void test_sprintf( void )
ok(!strcmp(buffer,"00000039"),"Pointer formatted incorrectly \"%s\"\n",buffer); ok(!strcmp(buffer,"00000039"),"Pointer formatted incorrectly \"%s\"\n",buffer);
ok( r==8, "return count wrong\n"); ok( r==8, "return count wrong\n");
format = "%Np";
r = sprintf(buffer,format,(void *)57);
ok(!strcmp(buffer,"00000039"),"Pointer formatted incorrectly \"%s\"\n",buffer);
ok( r==8, "return count wrong\n");
format = "%#-012p"; format = "%#-012p";
r = sprintf(buffer,format,(void *)57); r = sprintf(buffer,format,(void *)57);
ok(!strcmp(buffer,"0X00000039 "),"Pointer formatted incorrectly\n"); ok(!strcmp(buffer,"0X00000039 "),"Pointer formatted incorrectly\n");
...@@ -670,6 +680,11 @@ static void test_sprintf( void ) ...@@ -670,6 +680,11 @@ static void test_sprintf( void )
ok(!strcmp(buffer,""), "failed\n"); ok(!strcmp(buffer,""), "failed\n");
ok( r==0, "return count wrong\n"); ok( r==0, "return count wrong\n");
format = "%N";
r = sprintf(buffer, format,-1);
ok(!strcmp(buffer,""), "failed\n");
ok( r==0, "return count wrong\n");
format = "%H"; format = "%H";
r = sprintf(buffer, format,-1); r = sprintf(buffer, format,-1);
ok(!strcmp(buffer,"H"), "failed\n"); ok(!strcmp(buffer,"H"), "failed\n");
......
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