diff options
author | Wolfram Schneider <wosch@FreeBSD.org> | 1996-08-31 14:51:18 +0000 |
---|---|---|
committer | Wolfram Schneider <wosch@FreeBSD.org> | 1996-08-31 14:51:18 +0000 |
commit | 1a1ee31f101dbc1cfab71e6c07e6d0bc42b0cca5 (patch) | |
tree | e38a39ca1b59aadf68667083014042ec3ec47203 /usr.bin/locate | |
parent | 09a8dfa2609f6be79252c94d3b959ec2cf1a0835 (diff) | |
download | src-1a1ee31f101dbc1cfab71e6c07e6d0bc42b0cca5.tar.gz src-1a1ee31f101dbc1cfab71e6c07e6d0bc42b0cca5.zip |
NULL -> '\0'
Submitted by: Bruce, see also c-faq 5.6 and 5.9
Notes
Notes:
svn path=/head/; revision=17972
Diffstat (limited to 'usr.bin/locate')
-rw-r--r-- | usr.bin/locate/bigram/locate.bigram.c | 10 | ||||
-rw-r--r-- | usr.bin/locate/code/locate.code.c | 14 |
2 files changed, 12 insertions, 12 deletions
diff --git a/usr.bin/locate/bigram/locate.bigram.c b/usr.bin/locate/bigram/locate.bigram.c index 922d00e906b4..2103f6bb881d 100644 --- a/usr.bin/locate/bigram/locate.bigram.c +++ b/usr.bin/locate/bigram/locate.bigram.c @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: locate.bigram.c,v 1.4 1996/08/22 18:46:11 wosch Exp $ + * $Id: locate.bigram.c,v 1.5 1996/08/30 03:06:15 peter Exp $ */ #ifndef lint @@ -76,19 +76,19 @@ main(void) continue; /* Squelch characters that would botch the decoding. */ - for (cp = path; *cp != NULL; cp++) { + for (cp = path; *cp != '\0'; cp++) { /* chop newline */ if (*cp == '\n') - *cp = NULL; + *cp = '\0'; /* range */ else if (*cp < ASCII_MIN || *cp > ASCII_MAX) *cp = '?'; } /* skip longest common prefix */ - for (cp = path; *cp == *oldpath && *cp != NULL; cp++, oldpath++); + for (cp = path; *cp == *oldpath && *cp != '\0'; cp++, oldpath++); - while (*cp != NULL && *(cp+1) != NULL) { + while (*cp != '\0' && *(cp+1) != '\0') { bigram[*cp][*(cp+1)]++; cp += 2; } diff --git a/usr.bin/locate/code/locate.code.c b/usr.bin/locate/code/locate.code.c index 4846c73ba5ed..469b978921af 100644 --- a/usr.bin/locate/code/locate.code.c +++ b/usr.bin/locate/code/locate.code.c @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: locate.code.c,v 1.4 1996/08/22 18:46:13 wosch Exp $ */ #ifndef lint @@ -149,7 +149,7 @@ main(argc, argv) for (j = 0; j < UCHAR_MAX; j++) big[i][j] = (bg_t)-1; - for (cp = bigrams, i = 0; *cp != NULL; i += 2, cp += 2) + for (cp = bigrams, i = 0; *cp != '\0'; i += 2, cp += 2) big[(int)*cp][(int)*(cp + 1)] = (bg_t)i; #endif /* LOOKUP */ @@ -164,17 +164,17 @@ main(argc, argv) continue; /* Squelch characters that would botch the decoding. */ - for (cp = path; *cp != NULL; cp++) { + for (cp = path; *cp != '\0'; cp++) { /* chop newline */ if (*cp == '\n') - *cp = NULL; + *cp = '\0'; /* range */ else if (*cp < ASCII_MIN || *cp > ASCII_MAX) *cp = '?'; } /* Skip longest common prefix. */ - for (cp = path; *cp == *oldpath && *cp != NULL; cp++, oldpath++); + for (cp = path; *cp == *oldpath && *cp != '\0'; cp++, oldpath++); count = cp - path; diffcount = count - oldcount + OFFSET; @@ -187,8 +187,8 @@ main(argc, argv) if (putchar(diffcount) == EOF) err(1, "stdout"); - while (*cp != NULL) { - if (*(cp + 1) == NULL) { + while (*cp != '\0') { + if (*(cp + 1) == '\0') { if (putchar(*cp) == EOF) err(1, "stdout"); break; |