diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-11-18 23:25:46 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-11-18 23:25:46 +0000 |
commit | 1b1d36792e9d9c4ad9a67ad8bfc1a3be8f2104c1 (patch) | |
tree | 4523c0003244e52de8da34478fc4aa201cb778bf /debug/tst-chk1.c | |
parent | fb67e07dfb5403e6008e60be9896ced594014fec (diff) | |
download | glibc-1b1d36792e9d9c4ad9a67ad8bfc1a3be8f2104c1.tar.gz |
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.c | 17 |
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; } |