summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1997-09-18 14:08:40 +0000
committerphk <phk@FreeBSD.org>1997-09-18 14:08:40 +0000
commitd8ac4091605cafeed429956439b3365036470356 (patch)
tree86f85152c10afe3de06afc06d7738c614a3210cb /lib
parent2d831c7d21d4e39820d9fe862e7ec818476c083b (diff)
downloadFreeBSD-src-d8ac4091605cafeed429956439b3365036470356.zip
FreeBSD-src-d8ac4091605cafeed429956439b3365036470356.tar.gz
Many places in the code NULL is used in integer context, where
plain 0 should be used. This happens to work because we #define NULL to 0, but is stylistically wrong and can cause problems for people trying to port bits of code to other environments. PR: 2752 Submitted by: Arne Henrik Juul <arnej@imf.unit.no>
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/db/btree/bt_seq.c2
-rw-r--r--lib/libc/gen/getcap.c2
-rw-r--r--lib/libc/gen/getpwent.c4
-rw-r--r--lib/libftpio/ftpio.c4
4 files changed, 6 insertions, 6 deletions
diff --git a/lib/libc/db/btree/bt_seq.c b/lib/libc/db/btree/bt_seq.c
index 303b481..76e6275 100644
--- a/lib/libc/db/btree/bt_seq.c
+++ b/lib/libc/db/btree/bt_seq.c
@@ -358,7 +358,7 @@ __bt_first(t, key, erval, exactp)
* 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 --git a/lib/libc/gen/getcap.c b/lib/libc/gen/getcap.c
index 93d1952..a7de288 100644
--- a/lib/libc/gen/getcap.c
+++ b/lib/libc/gen/getcap.c
@@ -735,7 +735,7 @@ cgetnext(bp, db_array)
}
}
rp = buf;
- for(cp = nbuf; *cp != NULL; cp++)
+ for(cp = nbuf; *cp != '\0'; cp++)
if (*cp == '|' || *cp == ':')
break;
else
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c
index 9a19a15..dfe5d34 100644
--- a/lib/libc/gen/getpwent.c
+++ b/lib/libc/gen/getpwent.c
@@ -424,7 +424,7 @@ grpagain:
latch++;
}
again:
- if (getnetgrent(&host, &user, &domain) == NULL) {
+ if (getnetgrent(&host, &user, &domain) == 0) {
if ((gr = getgrnam(grp+2)) != NULL)
goto grpagain;
latch = 0;
@@ -448,7 +448,7 @@ again:
if (grp[1] == '@') {
setnetgrent(grp+2);
rv = 0;
- while(getnetgrent(&host, &user, &domain) != NULL) {
+ while(getnetgrent(&host, &user, &domain) != 0) {
store(user);
rv++;
}
diff --git a/lib/libftpio/ftpio.c b/lib/libftpio/ftpio.c
index bdb7d2e..5287477 100644
--- a/lib/libftpio/ftpio.c
+++ b/lib/libftpio/ftpio.c
@@ -14,7 +14,7 @@
* Turned inside out. Now returns xfers as new file ids, not as a special
* `state' of FTP_t
*
- * $Id$
+ * $Id: ftpio.c,v 1.25 1997/02/22 15:06:50 peter Exp $
*
*/
@@ -417,7 +417,7 @@ get_url_info(char *url_in, char *host_ret, int *port_ret, char *name_ret)
name = host = NULL;
/* XXX add http:// here or somewhere reasonable at some point XXX */
- if (strncmp("ftp://", url_in, 6) != NULL)
+ if (strncmp("ftp://", url_in, 6) != 0)
return FAILURE;
/* We like to stomp a lot on the URL string in dissecting it, so copy it first */
strncpy(url, url_in, BUFSIZ);
OpenPOWER on IntegriCloud