svn commit: r299582 - head/usr.bin/rpcinfo

Don Lewis truckman at FreeBSD.org
Fri May 13 00:50:55 UTC 2016


Author: truckman
Date: Fri May 13 00:50:53 2016
New Revision: 299582
URL: https://svnweb.freebsd.org/changeset/base/299582

Log:
  Simplify some overly complex code so that both humans and Coverity
  have a better chance of understanding it.
  
  Reported by:	Coverity
  CID:		1009684, 1006931

Modified:
  head/usr.bin/rpcinfo/rpcinfo.c

Modified: head/usr.bin/rpcinfo/rpcinfo.c
==============================================================================
--- head/usr.bin/rpcinfo/rpcinfo.c	Fri May 13 00:26:14 2016	(r299581)
+++ head/usr.bin/rpcinfo/rpcinfo.c	Fri May 13 00:50:53 2016	(r299582)
@@ -609,12 +609,13 @@ reply_proc(void *res, struct netbuf *who
 	} else {
 		hostname = hostbuf;
 	}
-	if (!(uaddr = taddr2uaddr(nconf, who))) {
-		uaddr = UNKNOWN;
-	}
-	printf("%s\t%s\n", uaddr, hostname);
-	if (strcmp(uaddr, UNKNOWN))
+	uaddr = taddr2uaddr(nconf, who);
+	if (uaddr == NULL) {
+		printf("%s\t%s\n", UNKNOWN, hostname);
+	} else {
+		printf("%s\t%s\n", uaddr, hostname);
 		free((char *)uaddr);
+	}
 	return (FALSE);
 }
 


More information about the svn-src-head mailing list