1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
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.
This commit is contained in:
Ulrich Drepper
2004-11-18 23:25:46 +00:00
parent fb67e07dfb
commit 1b1d36792e
9 changed files with 49 additions and 17 deletions

View File

@ -31,14 +31,14 @@ __fprintf_chk (FILE *fp, int flag, const char *format, ...)
_IO_acquire_lock (fp);
if (flag > 0)
fp->_flags2 |= _IO_FLAGS2_CHECK_PERCENT_N;
fp->_flags2 |= _IO_FLAGS2_FORTIFY;
va_start (ap, format);
done = vfprintf (fp, format, ap);
va_end (ap);
if (flag > 0)
fp->_flags2 &= ~_IO_FLAGS2_CHECK_PERCENT_N;
fp->_flags2 &= ~_IO_FLAGS2_FORTIFY;
_IO_release_lock (fp);
return done;