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);
}
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"