aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHajimu UMEMOTO <ume@FreeBSD.org>2015-11-05 11:02:28 +0000
committerHajimu UMEMOTO <ume@FreeBSD.org>2015-11-05 11:02:28 +0000
commitf3ffc9fdf90ffebc7544d217976ef0b480f06f39 (patch)
tree8c08cd69c1d723c3118416c1876afd5974b0b585
parent6f53a0386856459382cbffc7de262b80154af092 (diff)
Notes
-rw-r--r--usr.bin/netstat/route.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c
index 2ab35a0ffd7c..3f6918cc160a 100644
--- a/usr.bin/netstat/route.c
+++ b/usr.bin/netstat/route.c
@@ -637,14 +637,13 @@ netname4(in_addr_t in, in_addr_t mask)
trimdomain(cp, strlen(cp));
}
}
- inet_ntop(AF_INET, &in, nline, sizeof(line));
- if (cp != NULL) {
- if (strcpy(cp, nline) != 0)
- return (line);
+ if (cp != NULL)
strlcpy(line, cp, sizeof(line));
- } else
+ else {
+ inet_ntop(AF_INET, &in, nline, sizeof(nline));
strlcpy(line, nline, sizeof(line));
- domask(line + strlen(line), i, ntohl(mask));
+ domask(line + strlen(line), i, ntohl(mask));
+ }
return (line);
}