summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat/main.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2001-03-14 20:51:26 +0000
committerbrian <brian@FreeBSD.org>2001-03-14 20:51:26 +0000
commitdd004da290c46c50b50ee5c919ad6eab35694921 (patch)
tree5e787a2429ce382c01d683306212b6100c2c4928 /usr.bin/netstat/main.c
parent8a3521bf30812a63d06554a1d7f88325346ba791 (diff)
downloadFreeBSD-src-dd004da290c46c50b50ee5c919ad6eab35694921.zip
FreeBSD-src-dd004da290c46c50b50ee5c919ad6eab35694921.tar.gz
MAXHOSTNAMELEN includes space for a NUL.
Don't roll our own version of trimdomain(), use the one in libutil. Not objected to by: freebsd-audit
Diffstat (limited to 'usr.bin/netstat/main.c')
-rw-r--r--usr.bin/netstat/main.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index 9c128aa..5c23f3c 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -702,33 +702,3 @@ usage()
" netstat [-M core] [-N system] [-p protocol]");
exit(1);
}
-
-void
-trimdomain(cp)
- char *cp;
-{
- static char domain[MAXHOSTNAMELEN + 1];
- static int first = 1;
- char *s;
-
- if (first) {
- first = 0;
- if (gethostname(domain, MAXHOSTNAMELEN) == 0 &&
- (s = strchr(domain, '.')))
- (void) strcpy(domain, s + 1);
- else
- domain[0] = 0;
- }
-
- if (domain[0]) {
- while ((cp = strchr(cp, '.'))) {
- if (!strcasecmp(cp + 1, domain)) {
- *cp = 0; /* hit it */
- break;
- } else {
- cp++;
- }
- }
- }
-}
-
OpenPOWER on IntegriCloud