diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-02-27 21:22:20 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-02-27 21:22:20 +0000 |
commit | 584fd0812f68bd000624885be123bf263ed152ff (patch) | |
tree | 94d2c3c17b207d129fe0bcafa0f404a716b7a561 /usr.bin/netstat/mbuf.c | |
parent | 90d5475f7f5218e1e7bae851f6e3e5ed3e4440d1 (diff) |
do not divide by zero; helbig@Informatik.BA-Stuttgart.DE
Diffstat (limited to 'usr.bin/netstat/mbuf.c')
-rw-r--r-- | usr.bin/netstat/mbuf.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/netstat/mbuf.c b/usr.bin/netstat/mbuf.c index 94121d0e2e0..0aac955d58e 100644 --- a/usr.bin/netstat/mbuf.c +++ b/usr.bin/netstat/mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mbuf.c,v 1.6 1997/07/23 02:50:55 denny Exp $ */ +/* $OpenBSD: mbuf.c,v 1.7 1999/02/27 21:22:19 deraadt Exp $ */ /* $NetBSD: mbuf.c,v 1.9 1996/05/07 02:55:03 thorpej Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "from: @(#)mbuf.c 8.1 (Berkeley) 6/6/93"; #else -static char *rcsid = "$OpenBSD: mbuf.c,v 1.6 1997/07/23 02:50:55 denny Exp $"; +static char *rcsid = "$OpenBSD: mbuf.c,v 1.7 1999/02/27 21:22:19 deraadt Exp $"; #endif #endif /* not lint */ @@ -128,7 +128,8 @@ mbpr(mbaddr) totmem = totmbufs * MSIZE + mbstat.m_clusters * MCLBYTES; totfree = mbstat.m_clfree * MCLBYTES; printf("%u Kbytes allocated to network (%d%% in use)\n", - totmem / 1024, (totmem - totfree) * 100 / totmem); + totmem / 1024, + totmem ? (totmem - totfree) * 100 / totmem : 100); printf("%lu requests for memory denied\n", mbstat.m_drops); printf("%lu requests for memory delayed\n", mbstat.m_wait); printf("%lu calls to protocol drain routines\n", mbstat.m_drain); |