diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-06-18 09:58:06 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-06-18 09:58:06 +0000 |
commit | df2140f19b8e88fbcef5748d92fcf72f447586b1 (patch) | |
tree | bede0700f797552abf3d68edc67045e384f66b9f /usr.bin/netstat | |
parent | 56d08276e7b482dfc113ead896d8edac6183658b (diff) |
from netbsd Fix missing `)' in the sideways view of interfaces
(i.e. netstat -w 1). Bug pointed out by Chris G. Demetriou.
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r-- | usr.bin/netstat/if.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c index 8d36d2847ea..88868675e6d 100644 --- a/usr.bin/netstat/if.c +++ b/usr.bin/netstat/if.c @@ -1,4 +1,4 @@ -/* $NetBSD: if.c,v 1.16.4.1 1996/06/04 20:27:06 cgd Exp $ */ +/* $NetBSD: if.c,v 1.16.4.2 1996/06/07 21:46:46 thorpej Exp $ */ /* * Copyright (c) 1983, 1988, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "from: @(#)if.c 8.2 (Berkeley) 2/21/94"; #else -static char *rcsid = "$NetBSD: if.c,v 1.16.4.1 1996/06/04 20:27:06 cgd Exp $"; +static char *rcsid = "$NetBSD: if.c,v 1.16.4.2 1996/06/07 21:46:46 thorpej Exp $"; #endif #endif /* not lint */ @@ -295,12 +295,10 @@ sidewaysintpr(interval, off) for (off = firstifnet, ip = iftot; off;) { if (kread(off, (char *)&ifnet, sizeof ifnet)) break; - ip->ift_name[0] = '('; - bcopy(ifnet.if_xname, ip->ift_name + 1, IFNAMSIZ - 1); - if (interface && - strcmp(ip->ift_name + 1, interface) == 0) + bzero(ip->ift_name, sizeof(ip->ift_name)); + snprintf(ip->ift_name, IFNAMSIZ, "(%s)", ifnet.if_xname); + if (interface && strcmp(ifnet.if_xname, interface) == 0) interesting = ip; - ip->ift_name[IFNAMSIZ - 1] = '\0'; ip++; if (ip >= iftot + MAXIF - 2) break; |