Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src compare pointers with NULL not '\0'.



details:   https://anonhg.NetBSD.org/src/rev/0dab2c60e477
branches:  trunk
changeset: 448387:0dab2c60e477
user:      mrg <mrg%NetBSD.org@localhost>
date:      Fri Feb 01 08:29:03 2019 +0000

description:
compare pointers with NULL not '\0'.

diffstat:

 bin/csh/lex.c                        |  8 ++++----
 external/bsd/ppp/dist/pppd/options.c |  6 +++---
 usr.bin/basename/basename.c          |  6 +++---
 usr.bin/gcore/gcore.c                |  6 +++---
 usr.bin/mail/mime_attach.c           |  6 +++---
 usr.bin/tabs/tabs.c                  |  6 +++---
 usr.bin/tip/acu.c                    |  6 +++---
 usr.sbin/fwctl/fwcontrol.c           |  6 +++---
 8 files changed, 25 insertions(+), 25 deletions(-)

diffs (225 lines):

diff -r 1154b6438189 -r 0dab2c60e477 bin/csh/lex.c
--- a/bin/csh/lex.c     Fri Feb 01 06:49:58 2019 +0000
+++ b/bin/csh/lex.c     Fri Feb 01 08:29:03 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.33 2019/01/05 16:54:00 christos Exp $ */
+/* $NetBSD: lex.c,v 1.34 2019/02/01 08:29:03 mrg Exp $ */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)lex.c      8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: lex.c,v 1.33 2019/01/05 16:54:00 christos Exp $");
+__RCSID("$NetBSD: lex.c,v 1.34 2019/02/01 08:29:03 mrg Exp $");
 #endif
 #endif /* not lint */
 
@@ -1323,7 +1323,7 @@
        }
     }
     if (alvec) {
-       if ((alvecp = *alvec) != '\0') {
+       if ((alvecp = *alvec) != NULL) {
            alvec++;
            goto top;
        }
@@ -1346,7 +1346,7 @@
            doneinp = 1;
            reset();
        }
-       if ((evalp = *evalvec) != '\0') {
+       if ((evalp = *evalvec) != NULL) {
            evalvec++;
            goto top;
        }
diff -r 1154b6438189 -r 0dab2c60e477 external/bsd/ppp/dist/pppd/options.c
--- a/external/bsd/ppp/dist/pppd/options.c      Fri Feb 01 06:49:58 2019 +0000
+++ b/external/bsd/ppp/dist/pppd/options.c      Fri Feb 01 08:29:03 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: options.c,v 1.4 2014/10/25 21:11:37 christos Exp $     */
+/*     $NetBSD: options.c,v 1.5 2019/02/01 08:29:04 mrg Exp $  */
 
 /*
  * options.c - handles option processing for PPP.
@@ -47,7 +47,7 @@
 #define RCSID  "Id: options.c,v 1.102 2008/06/15 06:53:06 paulus Exp "
 static const char rcsid[] = RCSID;
 #else
-__RCSID("$NetBSD: options.c,v 1.4 2014/10/25 21:11:37 christos Exp $");
+__RCSID("$NetBSD: options.c,v 1.5 2019/02/01 08:29:04 mrg Exp $");
 #endif
 
 #include <ctype.h>
@@ -1787,7 +1787,7 @@
        option_error("unexpected = in name: %s", arg);
        return 0;
     }
-    if (arg == '\0') {
+    if (arg == NULL) {
        option_error("missing variable name for unset");
        return 0;
     }
diff -r 1154b6438189 -r 0dab2c60e477 usr.bin/basename/basename.c
--- a/usr.bin/basename/basename.c       Fri Feb 01 06:49:58 2019 +0000
+++ b/usr.bin/basename/basename.c       Fri Feb 01 08:29:03 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: basename.c,v 1.15 2011/08/29 14:24:03 joerg Exp $      */
+/*     $NetBSD: basename.c,v 1.16 2019/02/01 08:29:04 mrg Exp $        */
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)basename.c 8.4 (Berkeley) 5/4/95";
 #endif
-__RCSID("$NetBSD: basename.c,v 1.15 2011/08/29 14:24:03 joerg Exp $");
+__RCSID("$NetBSD: basename.c,v 1.16 2019/02/01 08:29:04 mrg Exp $");
 #endif /* not lint */
 
 #include <err.h>
@@ -78,7 +78,7 @@
        }
        if ((p = basename(*argv)) == NULL)
                err(1, "%s", *argv);
-       if (*++argv != '\0') {
+       if (*++argv != NULL) {
                int suffixlen, stringlen, off;
 
                suffixlen = strlen(*argv);
diff -r 1154b6438189 -r 0dab2c60e477 usr.bin/gcore/gcore.c
--- a/usr.bin/gcore/gcore.c     Fri Feb 01 06:49:58 2019 +0000
+++ b/usr.bin/gcore/gcore.c     Fri Feb 01 08:29:03 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gcore.c,v 1.11 2008/04/28 20:24:13 martin Exp $        */
+/*     $NetBSD: gcore.c,v 1.12 2019/02/01 08:29:04 mrg Exp $   */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: gcore.c,v 1.11 2008/04/28 20:24:13 martin Exp $");
+__RCSID("$NetBSD: gcore.c,v 1.12 2019/02/01 08:29:04 mrg Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -88,7 +88,7 @@
 
                errno = 0;
                lval = strtoul(argv[c], &ep, 0);
-               if (argv[c] == '\0' || *ep)
+               if (argv[c] == NULL || *ep)
                        errx(1, "`%s' is not a number.", argv[c]);
 
                if (errno == ERANGE && lval == ULONG_MAX)
diff -r 1154b6438189 -r 0dab2c60e477 usr.bin/mail/mime_attach.c
--- a/usr.bin/mail/mime_attach.c        Fri Feb 01 06:49:58 2019 +0000
+++ b/usr.bin/mail/mime_attach.c        Fri Feb 01 08:29:03 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mime_attach.c,v 1.19 2017/11/09 20:27:50 christos Exp $        */
+/*     $NetBSD: mime_attach.c,v 1.20 2019/02/01 08:29:04 mrg Exp $     */
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>
 #ifndef __lint__
-__RCSID("$NetBSD: mime_attach.c,v 1.19 2017/11/09 20:27:50 christos Exp $");
+__RCSID("$NetBSD: mime_attach.c,v 1.20 2019/02/01 08:29:04 mrg Exp $");
 #endif /* not __lint__ */
 
 #include <assert.h>
@@ -1018,7 +1018,7 @@
                        argc = getrawlist(np->n_name,
                            argv, (int)__arraycount(argv));
                else {
-                       if (np->n_name == '\0')
+                       if (np->n_name == NULL)
                                argc = 0;
                        else {
                                argc = 1;
diff -r 1154b6438189 -r 0dab2c60e477 usr.bin/tabs/tabs.c
--- a/usr.bin/tabs/tabs.c       Fri Feb 01 06:49:58 2019 +0000
+++ b/usr.bin/tabs/tabs.c       Fri Feb 01 08:29:03 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tabs.c,v 1.4 2011/09/16 15:39:29 joerg Exp $ */
+/* $NetBSD: tabs.c,v 1.5 2019/02/01 08:29:04 mrg Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 2008 \
 The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: tabs.c,v 1.4 2011/09/16 15:39:29 joerg Exp $");
+__RCSID("$NetBSD: tabs.c,v 1.5 2019/02/01 08:29:04 mrg Exp $");
 #endif /* not lint */
 
 #include <sys/ioctl.h>
@@ -112,7 +112,7 @@
                if (arg[0] == '\0') 
                        usage();
                if (arg[0] == '-' && arg[1] == '\0') {
-                       if (argv[i + 1] != '\0')
+                       if (argv[i + 1] != NULL)
                                tabs = argv[i + 1];
                        break;
                }
diff -r 1154b6438189 -r 0dab2c60e477 usr.bin/tip/acu.c
--- a/usr.bin/tip/acu.c Fri Feb 01 06:49:58 2019 +0000
+++ b/usr.bin/tip/acu.c Fri Feb 01 08:29:03 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acu.c,v 1.16 2011/09/06 18:33:01 joerg Exp $   */
+/*     $NetBSD: acu.c,v 1.17 2019/02/01 08:29:04 mrg Exp $     */
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)acu.c      8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: acu.c,v 1.16 2011/09/06 18:33:01 joerg Exp $");
+__RCSID("$NetBSD: acu.c,v 1.17 2019/02/01 08:29:04 mrg Exp $");
 #endif /* not lint */
 
 #include "tip.h"
@@ -183,7 +183,7 @@
 {
        acu_t *p;
 
-       for (p = acutable; p->acu_name != '\0'; p++)
+       for (p = acutable; p->acu_name != NULL; p++)
                if (!strcmp(s, p->acu_name))
                        return (p);
        return (NULL);
diff -r 1154b6438189 -r 0dab2c60e477 usr.sbin/fwctl/fwcontrol.c
--- a/usr.sbin/fwctl/fwcontrol.c        Fri Feb 01 06:49:58 2019 +0000
+++ b/usr.sbin/fwctl/fwcontrol.c        Fri Feb 01 08:29:03 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fwcontrol.c,v 1.16 2011/10/17 16:50:47 mbalmer Exp $   */
+/*     $NetBSD: fwcontrol.c,v 1.17 2019/02/01 08:29:04 mrg Exp $       */
 /*
  * Copyright (C) 2002
  *     Hidetoshi Shimokawa. All rights reserved.
@@ -34,7 +34,7 @@
  */
 #include <sys/cdefs.h>
 //__FBSDID("$FreeBSD: src/usr.sbin/fwcontrol/fwcontrol.c,v 1.23 2006/10/26 22:33:38 imp Exp $");
-__RCSID("$NetBSD: fwcontrol.c,v 1.16 2011/10/17 16:50:47 mbalmer Exp $");
+__RCSID("$NetBSD: fwcontrol.c,v 1.17 2019/02/01 08:29:04 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -117,7 +117,7 @@
        int i;
        long node;
 
-       if (nodestr == '\0')
+       if (nodestr == NULL)
                return -1;
 
        /*



Home | Main Index | Thread Index | Old Index