From 1b1d36792e9d9c4ad9a67ad8bfc1a3be8f2104c1 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 18 Nov 2004 23:25:46 +0000 Subject: Update. 2004-11-18 Ulrich Drepper * libio/libio.h (_IO_FLAGS2_FORTIFY): Renamed from _IO_FLAGS2_CHECK_PERCENT_N. * debug/fprintff_chk.c: Adjust all users. * debug/printf_chk.c: Likewise. * debug/vfprintf_chk.c: Likewise. * debug/vprintf_chk.c: Likewise. * debug/vsnprintf_chk.c: Likewise. * debug/vsprintf_chk.c: Likewise. * stdio-common/vfprintf.c: Likewise. Detect missing %N$ formats. * debug/tst-chk1.c: Test detection of missing %N$ formats. --- debug/tst-chk1.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'debug/tst-chk1.c') diff --git a/debug/tst-chk1.c b/debug/tst-chk1.c index 37320c3..0df660d 100644 --- a/debug/tst-chk1.c +++ b/debug/tst-chk1.c @@ -474,5 +474,22 @@ do_test (void) CHK_FAIL_END #endif + /* Check whether missing N$ formats are detected. */ + CHK_FAIL2_START + printf ("%3$d\n", 1, 2, 3, 4); + CHK_FAIL2_END + + CHK_FAIL2_START + fprintf (stdout, "%3$d\n", 1, 2, 3, 4); + CHK_FAIL2_END + + CHK_FAIL2_START + sprintf (buf, "%3$d\n", 1, 2, 3, 4); + CHK_FAIL2_END + + CHK_FAIL2_START + snprintf (buf, sizeof (buf), "%3$d\n", 1, 2, 3, 4); + CHK_FAIL2_END + return ret; } -- cgit v1.1