Date: Thu, 5 Nov 2015 11:02:29 +0000 (UTC) From: Hajimu UMEMOTO <ume@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290389 - head/usr.bin/netstat Message-ID: <201511051102.tA5B2TXq043367@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ume Date: Thu Nov 5 11:02:28 2015 New Revision: 290389 URL: https://svnweb.freebsd.org/changeset/base/290389 Log: Use returned network name from getnetbyaddr() correctly. Modified: head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Thu Nov 5 10:58:19 2015 (r290388) +++ head/usr.bin/netstat/route.c Thu Nov 5 11:02:28 2015 (r290389) @@ -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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511051102.tA5B2TXq043367>