diff options
Diffstat (limited to 'lib/libc/stdio/fgets.c')
-rw-r--r-- | lib/libc/stdio/fgets.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/stdio/fgets.c b/lib/libc/stdio/fgets.c index 8c2267421c2..fd7ff2b885b 100644 --- a/lib/libc/stdio/fgets.c +++ b/lib/libc/stdio/fgets.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: fgets.c,v 1.7 2004/09/28 18:12:44 otto Exp $"; +static char rcsid[] = "$OpenBSD: fgets.c,v 1.8 2005/05/28 04:34:05 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -85,7 +85,7 @@ fgets(char *buf, int n, FILE *fp) fp->_r -= len; fp->_p = t; (void)memcpy((void *)s, (void *)p, len); - s[len] = 0; + s[len] = '\0'; return (buf); } fp->_r -= len; @@ -94,6 +94,6 @@ fgets(char *buf, int n, FILE *fp) s += len; n -= len; } - *s = 0; + *s = '\0'; return (buf); } |