Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Apr 2016 06:02:27 +0000 (UTC)
From:      Marcelo Araujo <araujo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r298183 - head/usr.bin/rpcgen
Message-ID:  <201604180602.u3I62RLZ033844@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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, '.');
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604180602.u3I62RLZ033844>