From 545fbf37df673544fba0278eee877689eaa2f3c1 Mon Sep 17 00:00:00 2001 From: Martin Blapp Date: Wed, 29 Oct 2003 09:30:37 +0000 Subject: [PATCH] Don't compare a char to NULL. Obtained from: NetBSD --- usr.sbin/rpcbind/rpcb_stat.c | 4 ++-- usr.sbin/rpcbind/rpcb_svc_com.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/rpcbind/rpcb_stat.c b/usr.sbin/rpcbind/rpcb_stat.c index e2cf89e5f0e9..b10ed508b0bd 100644 --- a/usr.sbin/rpcbind/rpcb_stat.c +++ b/usr.sbin/rpcbind/rpcb_stat.c @@ -116,7 +116,7 @@ rpcbs_getaddr(rpcvers_t rtype, rpcprog_t prog, rpcvers_t vers, char *netid, return; if ((al->prog == prog) && (al->vers == vers) && (strcmp(al->netid, netid) == 0)) { - if ((uaddr == NULL) || (uaddr[0] == NULL)) + if ((uaddr == NULL) || (uaddr[0] == 0)) al->failure++; else al->success++; @@ -134,7 +134,7 @@ rpcbs_getaddr(rpcvers_t rtype, rpcprog_t prog, rpcvers_t vers, char *netid, al->prog = prog; al->vers = vers; al->netid = nconf->nc_netid; - if ((uaddr == NULL) || (uaddr[0] == '\0')) { + if ((uaddr == NULL) || (uaddr[0] == 0)) { al->failure = 1; al->success = 0; } else { diff --git a/usr.sbin/rpcbind/rpcb_svc_com.c b/usr.sbin/rpcbind/rpcb_svc_com.c index dbe312e00b79..0a72b662e43c 100644 --- a/usr.sbin/rpcbind/rpcb_svc_com.c +++ b/usr.sbin/rpcbind/rpcb_svc_com.c @@ -1438,7 +1438,7 @@ del_pmaplist(RPCB *arg) } else if (strcmp(arg->r_netid, tcptrans) == 0) { /* It is TCP */ prot = IPPROTO_TCP; - } else if (arg->r_netid[0] == NULL) { + } else if (arg->r_netid[0] == 0) { prot = 0; /* Remove all occurrences */ } else { /* Not an IP protocol */