Module: wine Branch: master Commit: a697fe51e0bff326c1a7fc8360672f128490a769 URL: http://source.winehq.org/git/wine.git/?a=commit;h=a697fe51e0bff326c1a7fc8360...
Author: Jesse Allen the3dfxdude@gmail.com Date: Mon Nov 13 20:56:19 2006 -0700
msvcrt: printf buffer overrun tests.
---
dlls/msvcrt/tests/printf.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/dlls/msvcrt/tests/printf.c b/dlls/msvcrt/tests/printf.c index b60dc17..7613c91 100644 --- a/dlls/msvcrt/tests/printf.c +++ b/dlls/msvcrt/tests/printf.c @@ -187,6 +187,18 @@ static void test_sprintf( void ) r = sprintf(buffer,format,(LONGLONG)100); 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"; r = sprintf(buffer,format,((ULONGLONG)0xffffffff)*0xffffffff); ok(!strcmp(buffer, "1"), "Problem with "ll" interpretation\n");