diff options
author | ngie <ngie@FreeBSD.org> | 2016-12-03 19:15:26 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2016-12-03 19:15:26 +0000 |
commit | 063da7380c330faf46a5ec19e66311aaf6564417 (patch) | |
tree | 039436ff54e1688bb8c47a636cb47ab5187102f4 /usr.bin | |
parent | 243fac270156b6dabd9fd97407bcfa1c8aadedd7 (diff) | |
download | FreeBSD-src-063da7380c330faf46a5ec19e66311aaf6564417.zip FreeBSD-src-063da7380c330faf46a5ec19e66311aaf6564417.tar.gz |
MFC r298183,r304226:
r298183 (by araujo):
Use NULL for pointers.
strrchr(3) will return NULL if the character does not appears in
the string.
r304226 (by araujo):
Use nitems() from sys/param.h.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/rpcgen/rpc_main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c index e50cfbc..d0953cf 100644 --- a/usr.bin/rpcgen/rpc_main.c +++ b/usr.bin/rpcgen/rpc_main.c @@ -82,11 +82,11 @@ static char pathbuf[MAXPATHLEN + 1]; static const char *allv[] = { "rpcgen", "-s", "udp", "-s", "tcp", }; -static int allc = sizeof (allv)/sizeof (allv[0]); +static int allc = nitems(allv); static const char *allnv[] = { "rpcgen", "-s", "netpath", }; -static int allnc = sizeof (allnv)/sizeof (allnv[0]); +static int allnc = nitems(allnv); /* * machinations for handling expanding argument list @@ -451,7 +451,7 @@ generate_guard(const char *pathname) char *guard, *tmp, *stopat; filename = strrchr(pathname, '/'); /* find last component */ - filename = ((filename == 0) ? pathname : filename+1); + filename = ((filename == NULL) ? pathname : filename+1); guard = xstrdup(filename); stopat = strrchr(guard, '.'); |