Loading...
--- Libc/Libc-320/stdio/FreeBSD/fgets.c
+++ Libc/Libc-1669.40.2/stdio/FreeBSD/fgets.c
@@ -13,10 +13,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
@@ -38,7 +34,7 @@
static char sccsid[] = "@(#)fgets.c 8.2 (Berkeley) 12/22/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdio/fgets.c,v 1.13 2002/08/13 09:30:41 tjr Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdio/fgets.c,v 1.14 2007/01/09 00:28:06 imp Exp $");
#include "namespace.h"
#include <stdio.h>
@@ -46,6 +42,7 @@
#include "un-namespace.h"
#include "local.h"
#include "libc_private.h"
+#include "libc_hooks_impl.h"
/*
* Read at most n-1 characters from the given file.
@@ -53,10 +50,7 @@
* Return first argument, or NULL if no characters were read.
*/
char *
-fgets(buf, n, fp)
- char *buf;
- int n;
- FILE *fp;
+fgets(char *buf, int n, FILE *fp)
{
size_t len;
char *s;
@@ -64,6 +58,9 @@
if (n <= 0) /* sanity check */
return (NULL);
+
+ libc_hooks_will_write(buf, n);
+ libc_hooks_will_write(fp, sizeof(*fp));
FLOCKFILE(fp);
ORIENT(fp, -1);