From a697fe51e0bff326c1a7fc8360672f128490a769 Mon Sep 17 00:00:00 2001 From: Jesse Allen Date: Mon, 13 Nov 2006 20:56:19 -0700 Subject: [PATCH] msvcrt: printf buffer overrun tests. --- dlls/msvcrt/tests/printf.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/msvcrt/tests/printf.c b/dlls/msvcrt/tests/printf.c index b60dc179503..7613c91240d 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");