Commit a697fe51 authored by Jesse Allen's avatar Jesse Allen Committed by Alexandre Julliard

msvcrt: printf buffer overrun tests.

parent 5b75c869
...@@ -187,6 +187,18 @@ static void test_sprintf( void ) ...@@ -187,6 +187,18 @@ static void test_sprintf( void )
r = sprintf(buffer,format,(LONGLONG)100); r = sprintf(buffer,format,(LONGLONG)100);
ok(!strcmp(buffer,"+00100 ") && r==8,"#-+ 08.5I64d failed: '%s'\n", buffer); ok(!strcmp(buffer,"+00100 ") && r==8,"#-+ 08.5I64d failed: '%s'\n", buffer);
format = "%.80I64d";
r = sprintf(buffer,format,(LONGLONG)1);
ok(r==80,"%s format failed\n", format);
format = "% .80I64d";
r = sprintf(buffer,format,(LONGLONG)1);
ok(r==81,"%s format failed\n", format);
format = "% .80d";
r = sprintf(buffer,format,1);
ok(r==81,"%s format failed\n", format);
format = "%lld"; format = "%lld";
r = sprintf(buffer,format,((ULONGLONG)0xffffffff)*0xffffffff); r = sprintf(buffer,format,((ULONGLONG)0xffffffff)*0xffffffff);
ok(!strcmp(buffer, "1"), "Problem with \"ll\" interpretation\n"); ok(!strcmp(buffer, "1"), "Problem with \"ll\" interpretation\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