diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2005-05-28 04:34:06 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2005-05-28 04:34:06 +0000 |
commit | 120c22334cd987d7d8c437fcf7f0b69fb9bf2d08 (patch) | |
tree | cfcc82c5302b6c63fcd76612929c3cdf2a540ca2 /lib/libc | |
parent | 19da88173cebc36d57d15b0842f8cc4c6696533a (diff) |
Use '\0' not 0 when storing as a char, part from Andrey Matveev.
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/stdio/fgetln.c | 4 | ||||
-rw-r--r-- | lib/libc/stdio/fgets.c | 6 | ||||
-rw-r--r-- | lib/libc/stdio/gets.c | 4 | ||||
-rw-r--r-- | lib/libc/stdio/vfscanf.c | 10 | ||||
-rw-r--r-- | lib/libc/stdio/vsnprintf.c | 4 |
5 files changed, 14 insertions, 14 deletions
diff --git a/lib/libc/stdio/fgetln.c b/lib/libc/stdio/fgetln.c index bea90932f44..f001243cfbf 100644 --- a/lib/libc/stdio/fgetln.c +++ b/lib/libc/stdio/fgetln.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: fgetln.c,v 1.5 2004/09/28 18:12:44 otto Exp $"; +static char *rcsid = "$OpenBSD: fgetln.c,v 1.6 2005/05/28 04:34:05 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -143,7 +143,7 @@ fgetln(FILE *fp, size_t *lenp) } *lenp = len; #ifdef notdef - fp->_lb._base[len] = 0; + fp->_lb._base[len] = '\0'; #endif return ((char *)fp->_lb._base); 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); } diff --git a/lib/libc/stdio/gets.c b/lib/libc/stdio/gets.c index 4d6a83d0b12..341084c2ff1 100644 --- a/lib/libc/stdio/gets.c +++ b/lib/libc/stdio/gets.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: gets.c,v 1.7 2004/09/28 18:12:44 otto Exp $"; +static char rcsid[] = "$OpenBSD: gets.c,v 1.8 2005/05/28 04:34:05 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -53,6 +53,6 @@ gets(char *buf) break; else *s++ = c; - *s = 0; + *s = '\0'; return (buf); } diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c index 2c0fc98ad6c..58a59145033 100644 --- a/lib/libc/stdio/vfscanf.c +++ b/lib/libc/stdio/vfscanf.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: vfscanf.c,v 1.12 2005/05/11 18:39:19 espie Exp $"; +static char rcsid[] = "$OpenBSD: vfscanf.c,v 1.13 2005/05/28 04:34:05 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -376,7 +376,7 @@ literal: n = p - p0; if (n == 0) goto match_failure; - *p = 0; + *p = '\0'; nassigned++; } nread += n; @@ -406,7 +406,7 @@ literal: if (fp->_r <= 0 && __srefill(fp)) break; } - *p = 0; + *p = '\0'; nread += p - p0; nassigned++; } @@ -533,7 +533,7 @@ literal: if ((flags & SUPPRESS) == 0) { u_quad_t res; - *p = 0; + *p = '\0'; res = (*ccfn)(buf, (char **)NULL, base); if (flags & POINTER) *va_arg(ap, void **) = @@ -631,7 +631,7 @@ literal: if ((flags & SUPPRESS) == 0) { double res; - *p = 0; + *p = '\0'; res = strtod(buf, (char **) NULL); if (flags & LONGDBL) *va_arg(ap, long double *) = res; diff --git a/lib/libc/stdio/vsnprintf.c b/lib/libc/stdio/vsnprintf.c index 11d17f6a430..4efa3e636b4 100644 --- a/lib/libc/stdio/vsnprintf.c +++ b/lib/libc/stdio/vsnprintf.c @@ -31,7 +31,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: vsnprintf.c,v 1.8 2005/04/30 09:25:17 espie Exp $"; +static char rcsid[] = "$OpenBSD: vsnprintf.c,v 1.9 2005/05/28 04:34:05 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <limits.h> @@ -61,6 +61,6 @@ vsnprintf(char *str, size_t n, const char *fmt, _BSD_VA_LIST_ ap) f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._w = n - 1; ret = vfprintf(&f, fmt, ap); - *f._p = 0; + *f._p = '\0'; return (ret); } |