diff options
author | 1999-03-15 15:59:08 +0000 | |
---|---|---|
committer | 1999-03-15 15:59:08 +0000 | |
commit | 9f1aa08f3ef014a2952290b8f3d033dbfab9df7d (patch) | |
tree | d8c10d5783319f98f843e7906a4baeb559fbf53c | |
parent | do not call nfsm_adj() with negative values; dm (diff) | |
download | wireguard-openbsd-9f1aa08f3ef014a2952290b8f3d033dbfab9df7d.tar.xz wireguard-openbsd-9f1aa08f3ef014a2952290b8f3d033dbfab9df7d.zip |
print subnets containing 0 octets correctly; peter
-rw-r--r-- | usr.bin/netstat/route.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c index 12fc9619b1a..847706826a8 100644 --- a/usr.bin/netstat/route.c +++ b/usr.bin/netstat/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.26 1999/02/24 22:57:35 angelos Exp $ */ +/* $OpenBSD: route.c,v 1.27 1999/03/15 15:59:08 deraadt Exp $ */ /* $NetBSD: route.c,v 1.15 1996/05/07 02:55:06 thorpej Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94"; #else -static char *rcsid = "$OpenBSD: route.c,v 1.26 1999/02/24 22:57:35 angelos Exp $"; +static char *rcsid = "$OpenBSD: route.c,v 1.27 1999/03/15 15:59:08 deraadt Exp $"; #endif #endif /* not lint */ @@ -627,12 +627,12 @@ netname(in, mask) if (cp) { strncpy(line, cp, sizeof(line) - 1); line[sizeof(line) - 1] = '\0'; - } else if ((in & 0xffffff) == 0) + } else if (mbits < 9) snprintf(line, sizeof line, "%u/%d", C(in >> 24), mbits); - else if ((in & 0xffff) == 0) + else if (mbits < 17) snprintf(line, sizeof line, "%u.%u/%d", C(in >> 24) , C(in >> 16), mbits); - else if ((in & 0xff) == 0) + else if (mbits < 25) snprintf(line, sizeof line, "%u.%u.%u/%d", C(in >> 24), C(in >> 16), C(in >> 8), mbits); else |