about summary refs log tree commit diff
path: root/debug/tst-chk1.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-11-18 23:25:46 +0000
committerUlrich Drepper <drepper@redhat.com>2004-11-18 23:25:46 +0000
commit1b1d36792e9d9c4ad9a67ad8bfc1a3be8f2104c1 (patch)
tree4523c0003244e52de8da34478fc4aa201cb778bf /debug/tst-chk1.c
parentfb67e07dfb5403e6008e60be9896ced594014fec (diff)
downloadglibc-1b1d36792e9d9c4ad9a67ad8bfc1a3be8f2104c1.tar.gz
glibc-1b1d36792e9d9c4ad9a67ad8bfc1a3be8f2104c1.tar.xz
glibc-1b1d36792e9d9c4ad9a67ad8bfc1a3be8f2104c1.zip
Update.
2004-11-18  Ulrich Drepper  <drepper@redhat.com>
	* 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.
Diffstat (limited to 'debug/tst-chk1.c')
-rw-r--r--debug/tst-chk1.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/debug/tst-chk1.c b/debug/tst-chk1.c
index 37320c3514..0df660d57f 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;
 }