NetBSD Problem Report #3629
Received: (qmail 23206 invoked from network); 15 May 1997 16:30:52 -0000
Message-Id: <19970515163037.9222.qmail@romberg.math.ntnu.no>
Date: 15 May 1997 16:30:37 -0000
From: arnej@math.ntnu.no
To: gnats-bugs@gnats.netbsd.org
Subject: Re: NULL is used instead of 0 many places
>Number: 3629
>Category: misc
>Synopsis: Re: NULL is used instead of 0 many places
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: gnats-admin
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu May 15 09:35:02 +0000 1997
>Closed-Date: Sat May 17 20:34:03 +0000 1997
>Last-Modified: Wed Jun 04 05:38:58 +0000 1997
>Originator:
>Release:
>Organization:
>Environment:
>Description:
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: pk
State-Changed-When: Sat May 17 13:34:03 PDT 1997
State-Changed-Why:
All done.
>Unformatted:
Here is an updated patch (applies cleanly as of May 15, 1997)
to netbsd-current for this problem. I hope this is the right
way to update PRs :-)
diff -ru orig-src/games/cribbage/io.c src/games/cribbage/io.c
--- orig-src/games/cribbage/io.c Sat Oct 14 00:58:06 1995
+++ src/games/cribbage/io.c Mon May 12 12:34:31 1997
@@ -256,10 +256,10 @@
if (!(line = getline()))
goto gotit;
p = p1 = line;
- while (*p1 != ' ' && *p1 != NULL)
+ while (*p1 != ' ' && *p1 != '\0')
++p1;
- *p1++ = NULL;
- if (*p == NULL)
+ *p1++ = '\0';
+ if (*p == '\0')
goto gotit;
/* IMPORTANT: no real card has 2 char first name */
@@ -295,17 +295,17 @@
if (rnk == EMPTY)
goto gotit;
p = p1;
- while (*p1 != ' ' && *p1 != NULL)
+ while (*p1 != ' ' && *p1 != '\0')
++p1;
- *p1++ = NULL;
- if (*p == NULL)
+ *p1++ = '\0';
+ if (*p == '\0')
goto gotit;
if (!strcmp("OF", p)) {
p = p1;
- while (*p1 != ' ' && *p1 != NULL)
+ while (*p1 != ' ' && *p1 != '\0')
++p1;
- *p1++ = NULL;
- if (*p == NULL)
+ *p1++ = '\0';
+ if (*p == '\0')
goto gotit;
}
sut = EMPTY;
@@ -354,7 +354,7 @@
for (sum = 0;;) {
msg(prompt);
- if (!(p = getline()) || *p == NULL) {
+ if (!(p = getline()) || *p == '\0') {
msg(quiet ? "Not a number" :
"That doesn't look like a number");
continue;
@@ -369,7 +369,7 @@
++p;
}
- if (*p != ' ' && *p != '\t' && *p != NULL)
+ if (*p != ' ' && *p != '\t' && *p != '\0')
sum = lo - 1;
if (sum >= lo && sum <= hi)
break;
diff -ru orig-src/games/cribbage/score.c src/games/cribbage/score.c
--- orig-src/games/cribbage/score.c Sat Oct 14 00:58:08 1995
+++ src/games/cribbage/score.c Mon May 12 12:34:31 1997
@@ -121,7 +121,7 @@
CARD h[(CINHAND + 1)];
char buf[32];
- expl[0] = NULL; /* initialize explanation */
+ expl[0] = '\0'; /* initialize explanation */
score = 0;
flag = TRUE;
k = hand[0].suit;
@@ -137,7 +137,7 @@
}
if (flag && n >= CINHAND) {
- if (do_explain && expl[0] != NULL)
+ if (do_explain && expl[0] != '\0')
strcat(expl, ", ");
if (starter.suit == k) {
score += 5;
@@ -146,13 +146,13 @@
} else
if (!crb) {
score += 4;
- if (do_explain && expl[0] != NULL)
+ if (do_explain && expl[0] != '\0')
strcat(expl, ", Four-flush");
else
strcpy(expl, "Four-flush");
}
}
- if (do_explain && expl[0] != NULL)
+ if (do_explain && expl[0] != '\0')
strcat(expl, ", ");
h[n] = starter;
sorthand(h, n + 1); /* sort by rank */
diff -ru orig-src/games/larn/io.c src/games/larn/io.c
--- orig-src/games/larn/io.c Mon Oct 14 17:28:11 1996
+++ src/games/larn/io.c Mon May 12 12:34:32 1997
@@ -416,11 +416,11 @@
register char *lgp,cc;
register int n=LINBUFSIZE,quote=0;
lgp = lgetwbuf;
- do cc=lgetc(); while ((cc <= 32) && (cc > NULL)); /* eat whitespace */
+ do cc=lgetc(); while ((cc <= 32) && (cc > '\0')); /* eat whitespace */
for ( ; ; --n,cc=lgetc())
{
- if ((cc==NULL) && (lgp==lgetwbuf)) return(NULL); /* EOF */
- if ((n<=1) || ((cc<=32) && (quote==0))) { *lgp=NULL; return(lgetwbuf); }
+ if ((cc=='\0') && (lgp==lgetwbuf)) return(NULL); /* EOF */
+ if ((n<=1) || ((cc<=32) && (quote==0))) { *lgp='\0'; return(lgetwbuf); }
if (cc != '"') *lgp++ = cc; else quote ^= 1;
}
}
@@ -436,10 +436,10 @@
register char *str=lgetwbuf;
for ( ; ; --i)
{
- if ((*str++ = ch = lgetc()) == NULL)
+ if ((*str++ = ch = lgetc()) == '\0')
{
if (str == lgetwbuf+1) return(NULL); /* EOF */
- ot: *str = NULL; return(lgetwbuf); /* line ended by EOF */
+ ot: *str = '\0'; return(lgetwbuf); /* line ended by EOF */
}
if ((ch=='\n') || (i<=1)) goto ot; /* line ended by \n */
}
diff -ru orig-src/games/rogue/inventory.c src/games/rogue/inventory.c
--- orig-src/games/rogue/inventory.c Sat Oct 14 01:02:46 1995
+++ src/games/rogue/inventory.c Mon May 12 12:34:32 1997
@@ -182,9 +182,9 @@
'b', "b down & left",
'c', "c call object",
'n', "n down & right",
- NULL, "<SHIFT><dir>: run that way",
+ '\0', "<SHIFT><dir>: run that way",
')', ") print current weapon",
- NULL, "<CTRL><dir>: run till adjacent",
+ '\0', "<CTRL><dir>: run till adjacent",
']', "] print current armor",
'f', "f<dir> fight till death or near death",
'=', "= print current rings",
diff -ru orig-src/gnu/usr.bin/gas/config/atof-ieee.c src/gnu/usr.bin/gas/config/atof-ieee.c
--- orig-src/gnu/usr.bin/gas/config/atof-ieee.c Thu Dec 21 13:14:59 1995
+++ src/gnu/usr.bin/gas/config/atof-ieee.c Mon May 12 12:34:33 1997
@@ -173,7 +173,7 @@
generic_floating_point_number.low = bits + MAX_PRECISION;
generic_floating_point_number.high = NULL;
generic_floating_point_number.leader = NULL;
- generic_floating_point_number.exponent = NULL;
+ generic_floating_point_number.exponent = 0;
generic_floating_point_number.sign = '\0';
/* Use more LittleNums than seems */
diff -ru orig-src/lib/libc/db/btree/bt_seq.c src/lib/libc/db/btree/bt_seq.c
--- orig-src/lib/libc/db/btree/bt_seq.c Sat May 4 13:35:41 1996
+++ src/lib/libc/db/btree/bt_seq.c Mon May 12 12:34:33 1997
@@ -364,7 +364,7 @@
* page) and return it.
*/
if ((ep = __bt_search(t, key, exactp)) == NULL)
- return (NULL);
+ return (0);
if (*exactp) {
if (F_ISSET(t, B_NODUPS)) {
*erval = *ep;
diff -ru orig-src/lib/libc/gen/getcap.c src/lib/libc/gen/getcap.c
--- orig-src/lib/libc/gen/getcap.c Fri Jan 24 13:12:17 1997
+++ src/lib/libc/gen/getcap.c Mon May 12 12:34:33 1997
@@ -741,7 +741,7 @@
}
}
rp = buf;
- for(cp = nbuf; *cp != NULL; cp++)
+ for(cp = nbuf; *cp != '\0'; cp++)
if (*cp == '|' || *cp == ':')
break;
else
diff -ru orig-src/libexec/ftpd/ftpcmd.y src/libexec/ftpd/ftpcmd.y
--- orig-src/libexec/ftpd/ftpcmd.y Sun Apr 27 13:33:50 1997
+++ src/libexec/ftpd/ftpcmd.y Mon May 12 12:34:34 1997
@@ -964,7 +964,7 @@
}
(void) alarm(0);
#ifdef HASSETPROCTITLE
- if (strncasecmp(cbuf, "PASS", 4) != NULL)
+ if (strncasecmp(cbuf, "PASS", 4) != 0)
setproctitle("%s: %s", proctitle, cbuf);
#endif /* HASSETPROCTITLE */
if ((cp = strchr(cbuf, '\r'))) {
diff -ru orig-src/libexec/lfs_cleanerd/library.c src/libexec/lfs_cleanerd/library.c
--- orig-src/libexec/lfs_cleanerd/library.c Sat Oct 14 02:05:24 1995
+++ src/libexec/lfs_cleanerd/library.c Mon May 12 12:34:34 1997
@@ -545,7 +545,7 @@
0, fid, seg_byte);
if (*(long *)segbuf < 0) {
err(0, "mmap_segment: mmap failed");
- return (NULL);
+ return (0);
}
} else {
#ifdef VERBOSE
@@ -556,7 +556,7 @@
*segbuf = malloc(ssize);
if (!*segbuf) {
err(0, "mmap_segment: malloc failed");
- return(NULL);
+ return(0);
}
/* read the segment data into the buffer */
diff -ru orig-src/sbin/mount/mount.c src/sbin/mount/mount.c
--- orig-src/sbin/mount/mount.c Mon Mar 10 13:14:22 1997
+++ src/sbin/mount/mount.c Mon May 12 12:34:35 1997
@@ -100,7 +100,7 @@
{ MNT_ROOTFS, 1, "root file system" },
{ MNT_SYNCHRONOUS, 0, "synchronous" },
{ MNT_UNION, 0, "union" },
- { NULL }
+ { 0, 0, NULL }
};
int
diff -ru orig-src/sbin/restore/dirs.c src/sbin/restore/dirs.c
--- orig-src/sbin/restore/dirs.c Tue Apr 15 13:14:58 1997
+++ src/sbin/restore/dirs.c Mon May 12 12:34:35 1997
@@ -306,7 +306,7 @@
while (*path == '/')
path++;
dp = NULL;
- while ((name = strsep(&path, "/")) != NULL && *name != NULL) {
+ while ((name = strsep(&path, "/")) != NULL && *name != '\0') {
if ((dp = searchdir(ino, name)) == NULL)
return (NULL);
ino = dp->d_ino;
diff -ru orig-src/sbin/restore/restore.c src/sbin/restore/restore.c
--- orig-src/sbin/restore/restore.c Wed Mar 19 13:19:43 1997
+++ src/sbin/restore/restore.c Mon May 12 12:34:35 1997
@@ -819,7 +819,7 @@
ep->e_flags &= ~KEEP;
if (ep->e_type == NODE)
ep->e_flags &= ~(NEW|EXISTED);
- if (ep->e_flags != NULL)
+ if (ep->e_flags != 0)
badentry(ep, "incomplete operations");
}
}
diff -ru orig-src/sys/miscfs/nullfs/null_vnops.c src/sys/miscfs/nullfs/null_vnops.c
--- orig-src/sys/miscfs/nullfs/null_vnops.c Mon Oct 14 18:41:08 1996
+++ src/sys/miscfs/nullfs/null_vnops.c Mon May 12 12:34:36 1997
@@ -362,7 +362,7 @@
struct proc *a_p;
} */ *ap = v;
int error;
- if ((error = null_bypass(ap)) != NULL)
+ if ((error = null_bypass(ap)) != 0)
return (error);
/* Requires that arguments be restored. */
ap->a_vap->va_fsid = ap->a_vp->v_mount->mnt_stat.f_fsid.val[0];
diff -ru orig-src/sys/msdosfs/msdosfs_fat.c src/sys/msdosfs/msdosfs_fat.c
--- orig-src/sys/msdosfs/msdosfs_fat.c Mon Oct 14 18:42:19 1996
+++ src/sys/msdosfs/msdosfs_fat.c Mon May 12 12:34:37 1997
@@ -628,7 +628,7 @@
while (++idx <= max_idx) {
if (len >= count)
break;
- if ((map = pmp->pm_inusemap[idx]) != NULL) {
+ if ((map = pmp->pm_inusemap[idx]) != 0) {
len += ffs(map) - 1;
break;
}
diff -ru orig-src/usr.bin/error/touch.c src/usr.bin/error/touch.c
--- orig-src/usr.bin/error/touch.c Sat Mar 22 13:35:16 1997
+++ src/usr.bin/error/touch.c Mon May 12 12:34:37 1997
@@ -599,7 +599,7 @@
botch = 0;
oktorm = 1;
- while((nread = fread(edbuf, 1, sizeof(edbuf), o_touchedfile)) != NULL){
+ while((nread = fread(edbuf, 1, sizeof(edbuf), o_touchedfile)) != 0) {
if (nread != fwrite(edbuf, 1, nread, n_touchedfile)){
/*
* Catastrophe in temporary area: file system full?
@@ -659,7 +659,7 @@
{
int nread;
- while((nread = fread(edbuf, 1, sizeof(edbuf), tmpfile)) != NULL){
+ while((nread = fread(edbuf, 1, sizeof(edbuf), tmpfile)) != 0) {
if (mustwrite(edbuf, nread, preciousfile) == 0)
return(0);
}
diff -ru orig-src/usr.bin/finger/finger.c src/usr.bin/finger/finger.c
--- orig-src/usr.bin/finger/finger.c Fri Jan 10 13:23:53 1997
+++ src/usr.bin/finger/finger.c Mon May 12 12:34:38 1997
@@ -167,7 +167,7 @@
(void)fprintf(stderr, "finger: can't read %s.\n", _PATH_UTMP);
exit(2);
}
- name[UT_NAMESIZE] = NULL;
+ name[UT_NAMESIZE] = '\0';
while (fread((char *)&user, sizeof(user), 1, stdin) == 1) {
if (!user.ut_name[0])
continue;
diff -ru orig-src/usr.bin/finger/net.c src/usr.bin/finger/net.c
--- orig-src/usr.bin/finger/net.c Fri Jan 10 13:23:54 1997
+++ src/usr.bin/finger/net.c Mon May 12 12:34:38 1997
@@ -68,7 +68,7 @@
lastc = 0;
if (!(host = strrchr(name, '@')))
return;
- *host++ = NULL;
+ *host++ = '\0';
if (inet_aton(host, &sin.sin_addr) == 0) {
hp = gethostbyname(host);
if (hp == 0) {
diff -ru orig-src/usr.bin/finger/util.c src/usr.bin/finger/util.c
--- orig-src/usr.bin/finger/util.c Fri Jan 10 13:23:55 1997
+++ src/usr.bin/finger/util.c Mon May 12 12:34:38 1997
@@ -193,7 +193,7 @@
(long)pn->uid * sizeof(ll) ||
read(fd, (char *)&ll, sizeof(ll)) != sizeof(ll)) {
/* as if never logged in */
- ll.ll_line[0] = ll.ll_host[0] = NULL;
+ ll.ll_line[0] = ll.ll_host[0] = '\0';
ll.ll_time = 0;
}
if ((w = pn->whead) == NULL)
diff -ru orig-src/usr.bin/ftp/cmds.c src/usr.bin/ftp/cmds.c
--- orig-src/usr.bin/ftp/cmds.c Mon Apr 14 13:29:50 1997
+++ src/usr.bin/ftp/cmds.c Mon May 12 12:34:39 1997
@@ -339,7 +339,7 @@
if (!*tp) {
tp = cp;
tp2 = tmpbuf;
- while ((*tp2 = *tp) != NULL) {
+ while ((*tp2 = *tp) != '\0') {
if (isupper(*tp2)) {
*tp2 = 'a' + *tp2 - 'A';
}
@@ -482,7 +482,7 @@
if (!*tp) {
tp = argv[2];
tp2 = tmpbuf;
- while ((*tp2 = *tp) != NULL) {
+ while ((*tp2 = *tp) != '\0') {
if (isupper(*tp2)) {
*tp2 = 'a' + *tp2 - 'A';
}
@@ -582,7 +582,7 @@
if (mflag && confirm(argv[0], cp)) {
tp = cp;
if (mcase) {
- for (tp2 = tmpbuf; (ch = *tp++) != NULL; )
+ for (tp2 = tmpbuf; (ch = *tp++) != 0; )
*tp2++ = isupper(ch) ? tolower(ch) : ch;
*tp2 = '\0';
tp = tmpbuf;
diff -ru orig-src/usr.bin/kdump/kdump.c src/usr.bin/kdump/kdump.c
--- orig-src/usr.bin/kdump/kdump.c Tue Jan 28 13:24:07 1997
+++ src/usr.bin/kdump/kdump.c Mon May 12 12:34:40 1997
@@ -107,7 +107,7 @@
{ "sunos", sunos_syscallnames, SUNOS_SYS_MAXSYSCALL },
{ "svr4", svr4_syscallnames, SVR4_SYS_MAXSYSCALL },
{ "ultrix", ultrix_syscallnames, ULTRIX_SYS_MAXSYSCALL },
- { NULL, NULL, NULL }
+ { NULL, NULL, 0 }
};
struct emulation *current;
diff -ru orig-src/usr.bin/locate/locate/locate.c src/usr.bin/locate/locate/locate.c
--- orig-src/usr.bin/locate/locate/locate.c Sat Oct 14 04:14:24 1995
+++ src/usr.bin/locate/locate/locate.c Mon May 12 12:34:42 1997
@@ -134,15 +134,15 @@
c &= PARITY - 1;
*p++ = bigram1[c], *p++ = bigram2[c];
}
- *p-- = NULL;
+ *p-- = '\0';
cutoff = (found ? path : path + count);
for (found = 0, s = p; s >= cutoff; s--)
if (*s == *patend) { /* fast first char check */
- for (p = patend - 1, q = s - 1; *p != NULL;
+ for (p = patend - 1, q = s - 1; *p != '\0';
p--, q--)
if (*q != *p)
break;
- if (*p == NULL) { /* fast match success */
+ if (*p == '\0') { /* fast match success */
found = 1;
if (!globflag ||
!fnmatch(pathpart, path, 0))
diff -ru orig-src/usr.bin/lock/lock.c src/usr.bin/lock/lock.c
--- orig-src/usr.bin/lock/lock.c Thu May 9 13:33:06 1996
+++ src/usr.bin/lock/lock.c Mon May 12 12:34:42 1997
@@ -158,7 +158,7 @@
(void)tcsetattr(0, TCSADRAIN, &tty);
exit(1);
}
- s[0] = NULL;
+ s[0] = '\0';
mypw = s1;
}
diff -ru orig-src/usr.bin/mail/cmd1.c src/usr.bin/mail/cmd1.c
--- orig-src/usr.bin/mail/cmd1.c Sun Dec 29 13:36:23 1996
+++ src/usr.bin/mail/cmd1.c Mon May 12 12:34:42 1997
@@ -161,7 +161,7 @@
int *msgvec = v;
register int *ip;
- for (ip = msgvec; *ip != NULL; ip++)
+ for (ip = msgvec; *ip != 0; ip++)
printhead(*ip);
if (--ip >= msgvec)
dot = &message[*ip - 1];
diff -ru orig-src/usr.bin/mail/cmd2.c src/usr.bin/mail/cmd2.c
--- orig-src/usr.bin/mail/cmd2.c Mon Oct 14 18:55:11 1996
+++ src/usr.bin/mail/cmd2.c Mon May 12 12:34:42 1997
@@ -66,7 +66,7 @@
register int *ip, *ip2;
int list[2], mdot;
- if (*msgvec != NULL) {
+ if (*msgvec != 0) {
/*
* If some messages were supplied, find the
@@ -81,10 +81,10 @@
* message list which follows dot.
*/
- for (ip = msgvec; *ip != NULL; ip++)
+ for (ip = msgvec; *ip != 0; ip++)
if (*ip > mdot)
break;
- if (*ip == NULL)
+ if (*ip == 0)
ip = msgvec;
ip2 = ip;
do {
@@ -93,9 +93,9 @@
dot = mp;
goto hitit;
}
- if (*ip2 != NULL)
+ if (*ip2 != 0)
ip2++;
- if (*ip2 == NULL)
+ if (*ip2 == 0)
ip2 = msgvec;
} while (ip2 != ip);
printf("No messages applicable\n");
@@ -129,7 +129,7 @@
*/
list[0] = dot - &message[0] + 1;
- list[1] = NULL;
+ list[1] = 0;
return(type(list));
}
@@ -180,11 +180,11 @@
return(1);
if (!f) {
*msgvec = first(0, MMNORM);
- if (*msgvec == NULL) {
+ if (*msgvec == 0) {
printf("No messages to %s.\n", cmd);
return(1);
}
- msgvec[1] = NULL;
+ msgvec[1] = 0;
}
if (f && getmsglist(str, msgvec, 0) < 0)
return(1);
@@ -304,7 +304,7 @@
list[0] = dot - &message[0] + 1;
if (list[0] > lastdot) {
touch(dot);
- list[1] = NULL;
+ list[1] = 0;
return(type(list));
}
printf("At EOF\n");
@@ -326,18 +326,18 @@
register *ip;
int last;
- last = NULL;
- for (ip = msgvec; *ip != NULL; ip++) {
+ last = 0;
+ for (ip = msgvec; *ip != 0; ip++) {
mp = &message[*ip - 1];
touch(mp);
mp->m_flag |= MDELETED|MTOUCH;
mp->m_flag &= ~(MPRESERVE|MSAVED|MBOX);
last = *ip;
}
- if (last != NULL) {
+ if (last != 0) {
dot = &message[last-1];
last = first(0, MDELETED);
- if (last != NULL) {
+ if (last != 0) {
dot = &message[last-1];
return(0);
}
diff -ru orig-src/usr.bin/mail/cmd3.c src/usr.bin/mail/cmd3.c
--- orig-src/usr.bin/mail/cmd3.c Sun Dec 29 13:36:24 1996
+++ src/usr.bin/mail/cmd3.c Mon May 12 12:34:43 1997
@@ -305,7 +305,7 @@
printf("Cannot \"preserve\" in edit mode\n");
return(1);
}
- for (ip = msgvec; *ip != NULL; ip++) {
+ for (ip = msgvec; *ip != 0; ip++) {
mesg = *ip;
mp = &message[mesg-1];
mp->m_flag |= MPRESERVE;
@@ -325,7 +325,7 @@
int *msgvec = v;
register int *ip;
- for (ip = msgvec; *ip != NULL; ip++) {
+ for (ip = msgvec; *ip != 0; ip++) {
dot = &message[*ip-1];
dot->m_flag &= ~(MREAD|MTOUCH);
dot->m_flag |= MSTATUS;
@@ -344,7 +344,7 @@
register struct message *mp;
register int *ip, mesg;
- for (ip = msgvec; *ip != NULL; ip++) {
+ for (ip = msgvec; *ip != 0; ip++) {
mesg = *ip;
mp = &message[mesg-1];
printf("%d: %d/%ld\n", mesg, mp->m_lines, mp->m_size);
diff -ru orig-src/usr.bin/mail/collect.c src/usr.bin/mail/collect.c
--- orig-src/usr.bin/mail/collect.c Mon Oct 14 18:55:17 1996
+++ src/usr.bin/mail/collect.c Mon May 12 12:34:43 1997
@@ -542,11 +542,11 @@
return(0);
if (*msgvec == 0) {
*msgvec = first(0, MMNORM);
- if (*msgvec == NULL) {
+ if (*msgvec == 0) {
printf("No appropriate messages\n");
return(0);
}
- msgvec[1] = NULL;
+ msgvec[1] = 0;
}
if (f == 'f' || f == 'F')
tabst = NOSTR;
diff -ru orig-src/usr.bin/mail/lex.c src/usr.bin/mail/lex.c
--- orig-src/usr.bin/mail/lex.c Sun Dec 29 13:36:25 1996
+++ src/usr.bin/mail/lex.c Mon May 12 12:34:43 1997
@@ -389,9 +389,9 @@
if (c == 0) {
*msgvec = first(com->c_msgflag,
com->c_msgmask);
- msgvec[1] = NULL;
+ msgvec[1] = 0;
}
- if (*msgvec == NULL) {
+ if (*msgvec == 0) {
printf("No applicable messages\n");
break;
}
diff -ru orig-src/usr.bin/mkstr/mkstr.c src/usr.bin/mkstr/mkstr.c
--- orig-src/usr.bin/mkstr/mkstr.c Sat Oct 14 04:18:36 1995
+++ src/usr.bin/mkstr/mkstr.c Mon May 12 12:34:43 1997
@@ -237,7 +237,7 @@
int mesgpt = 0;
rewind(mesgread);
- while (fgetNUL(buf, sizeof buf, mesgread) != NULL) {
+ while (fgetNUL(buf, sizeof buf, mesgread) != 0) {
hashit(buf, 0, mesgpt);
mesgpt += strlen(buf) + 2;
}
@@ -312,5 +312,5 @@
*buf++ = c;
*buf++ = 0;
getc(file);
- return ((feof(file) || ferror(file)) ? NULL : 1);
+ return ((feof(file) || ferror(file)) ? 0 : 1);
}
diff -ru orig-src/usr.bin/msgs/msgs.c src/usr.bin/msgs/msgs.c
--- orig-src/usr.bin/msgs/msgs.c Sat Oct 14 04:19:16 1995
+++ src/usr.bin/msgs/msgs.c Mon May 12 12:34:44 1997
@@ -757,7 +757,7 @@
for (n=0; in[n] > ' '; n++) { /* sizeof fname? */
fname[n] = in[n];
}
- fname[n] = NULL;
+ fname[n] = '\0';
}
else
strcpy(fname, "Messages");
@@ -801,7 +801,7 @@
seensubj = seenfrom = NO;
local = YES;
- subj[0] = from[0] = date[0] = NULL;
+ subj[0] = from[0] = date[0] = '\0';
/*
* Is this a normal message?
@@ -821,12 +821,12 @@
*ptr++ = *in++;
/* what about sizeof from ? */
}
- *ptr = NULL;
+ *ptr = '\0';
if (*(in = nxtfld(in)))
strncpy(date, in, sizeof date);
else {
date[0] = '\n';
- date[1] = NULL;
+ date[1] = '\0';
}
}
else {
diff -ru orig-src/usr.bin/rdist/expand.c src/usr.bin/rdist/expand.c
--- orig-src/usr.bin/rdist/expand.c Mon Oct 14 18:57:45 1996
+++ src/usr.bin/rdist/expand.c Mon May 12 12:34:44 1997
@@ -181,7 +181,7 @@
savec = *tail;
*tail = '\0';
}
- tp = lookup(cp, NULL, 0);
+ tp = lookup(cp, 0, 0);
if (savec != '\0')
*tail = savec;
if (tp != NULL) {
diff -ru orig-src/usr.bin/strip/strip.c src/usr.bin/strip/strip.c
--- orig-src/usr.bin/strip/strip.c Mon Oct 14 18:58:09 1996
+++ src/usr.bin/strip/strip.c Mon May 12 12:34:44 1997
@@ -255,7 +255,7 @@
if (sym->n_type & N_STAB)
continue;
/* empty symbol? */
- if (sym->strx == NULL)
+ if (sym->strx == 0)
continue;
/* compute a pointer to its name */
p = strbase + sym->strx;
diff -ru orig-src/usr.bin/tip/vars.c src/usr.bin/tip/vars.c
--- orig-src/usr.bin/tip/vars.c Sat Oct 14 04:27:23 1995
+++ src/usr.bin/tip/vars.c Mon May 12 12:34:44 1997
@@ -113,5 +113,5 @@
"le", (char *)FALSE },
{ "parity", STRING|INIT|IREMOTE, (READ|WRITE)<<PUBLIC,
"par", (char *)&PA },
- { NOSTR, NULL, NULL, NOSTR, NOSTR }
+ { NOSTR, 0, 0, NOSTR, NOSTR }
};
diff -ru orig-src/usr.bin/tset/map.c src/usr.bin/tset/map.c
--- orig-src/usr.bin/tset/map.c Fri Nov 15 13:21:58 1996
+++ src/usr.bin/tset/map.c Mon May 12 12:34:45 1997
@@ -142,7 +142,7 @@
mapp->speed = baudrate(p);
}
- if (*arg == NULL) /* Non-optional type. */
+ if (*arg == '\0') /* Non-optional type. */
goto badmopt;
mapp->type = arg;
diff -ru orig-src/usr.bin/uudecode/uudecode.c src/usr.bin/uudecode/uudecode.c
--- orig-src/usr.bin/uudecode/uudecode.c Sat Oct 14 04:31:11 1995
+++ src/usr.bin/uudecode/uudecode.c Mon May 12 12:34:45 1997
@@ -123,7 +123,7 @@
filename);
return(1);
}
- *p++ = NULL;
+ *p++ = '\0';
if (!(pw = getpwnam(buf + 1))) {
(void)fprintf(stderr, "uudecode: %s: no user %s.\n",
filename, buf);
diff -ru orig-src/usr.bin/vacation/vacation.c src/usr.bin/vacation/vacation.c
--- orig-src/usr.bin/vacation/vacation.c Sat Oct 14 04:31:26 1995
+++ src/usr.bin/vacation/vacation.c Mon May 12 12:34:45 1997
@@ -291,7 +291,7 @@
} ignore[] = {
"-request", 8, "postmaster", 10, "uucp", 4,
"mailer-daemon", 13, "mailer", 6, "-relay", 6,
- NULL, NULL,
+ NULL, 0,
};
register struct ignore *cur;
register int len;
diff -ru orig-src/usr.bin/vgrind/vfontedpr.c src/usr.bin/vgrind/vfontedpr.c
--- orig-src/usr.bin/vgrind/vfontedpr.c Fri Mar 22 13:29:09 1996
+++ src/usr.bin/vgrind/vfontedpr.c Mon May 12 12:34:46 1997
@@ -249,7 +249,7 @@
cpp = l_keywds;
while (*cp) {
while (*cp == ' ' || *cp =='\t')
- *cp++ = NULL;
+ *cp++ = '\0';
if (*cp)
*cpp++ = cp;
while (*cp != ' ' && *cp != '\t' && *cp)
@@ -291,7 +291,7 @@
_escaped = FALSE;
blklevel = 0;
for (psptr=0; psptr<PSMAX; psptr++) {
- pstack[psptr][0] = NULL;
+ pstack[psptr][0] = '\0';
plstack[psptr] = 0;
}
psptr = -1;
@@ -375,7 +375,7 @@
if (psptr < PSMAX) {
++psptr;
strncpy (pstack[psptr], pname, PNAMELEN);
- pstack[psptr][PNAMELEN] = NULL;
+ pstack[psptr][PNAMELEN] = '\0';
plstack[psptr] = blklevel;
}
}
@@ -680,7 +680,7 @@
isproc(s)
char *s;
{
- pname[0] = NULL;
+ pname[0] = '\0';
if (!l_toplex || blklevel == 0)
if (expmatch (s, l_prcbeg, pname) != NIL) {
return (TRUE);
diff -ru orig-src/usr.bin/xstr/xstr.c src/usr.bin/xstr/xstr.c
--- orig-src/usr.bin/xstr/xstr.c Sat Oct 14 04:44:08 1995
+++ src/usr.bin/xstr/xstr.c Mon May 12 12:34:46 1997
@@ -283,7 +283,7 @@
return;
for (;;) {
mesgpt = tellpt;
- if (fgetNUL(buf, sizeof buf, mesgread) == NULL)
+ if (fgetNUL(buf, sizeof buf, mesgread) == 0)
break;
ignore(hashit(buf, 0));
}
@@ -301,7 +301,7 @@
while (--rmdr > 0 && (c = xgetc(file)) != 0 && c != EOF)
*buf++ = c;
*buf++ = 0;
- return ((feof(file) || ferror(file)) ? NULL : 1);
+ return ((feof(file) || ferror(file)) ? 0 : 1);
}
xgetc(file)
diff -ru orig-src/usr.sbin/syslogd/syslogd.c src/usr.sbin/syslogd/syslogd.c
--- orig-src/usr.sbin/syslogd/syslogd.c Sat Apr 26 13:37:13 1997
+++ src/usr.sbin/syslogd/syslogd.c Mon May 12 12:34:46 1997
@@ -930,7 +930,7 @@
*/
for (p = cline; isspace(*p); ++p)
continue;
- if (*p == NULL || *p == '#')
+ if (*p == '\0' || *p == '#')
continue;
for (p = strchr(cline, '\0'); isspace(*--p);)
continue;
(end of patch)
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.