svn commit: r298183 - head/usr.bin/rpcgen

Marcelo Araujo araujo at FreeBSD.org
Mon Apr 18 06:02:28 UTC 2016


Author: araujo
Date: Mon Apr 18 06:02:26 2016
New Revision: 298183
URL: https://svnweb.freebsd.org/changeset/base/298183

Log:
  Use NULL for pointers.
  
  strrchr(3) will return NULL if the character does not appears in
  the string.
  
  MFC after:	2 weeks.

Modified:
  head/usr.bin/rpcgen/rpc_main.c

Modified: head/usr.bin/rpcgen/rpc_main.c
==============================================================================
--- head/usr.bin/rpcgen/rpc_main.c	Mon Apr 18 05:46:18 2016	(r298182)
+++ head/usr.bin/rpcgen/rpc_main.c	Mon Apr 18 06:02:26 2016	(r298183)
@@ -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, '.');
 


More information about the svn-src-head mailing list