diff options
author | 2005-05-28 04:34:05 +0000 | |
---|---|---|
committer | 2005-05-28 04:34:05 +0000 | |
commit | fd14b462090ec42522658235a4979b806664be52 (patch) | |
tree | be79bbefeee95fa22b5fe01d7a16a31c2b938503 /lib/libc/stdio/fgets.c | |
parent | Handle XS_SHORTSENSE error codes in ioctl situations. From NetBSD. (diff) | |
download | wireguard-openbsd-fd14b462090ec42522658235a4979b806664be52.tar.xz wireguard-openbsd-fd14b462090ec42522658235a4979b806664be52.zip |
Use '\0' not 0 when storing as a char, part from Andrey Matveev.
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); } |