summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat/mbuf.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1997-11-10 08:03:36 +0000
committerache <ache@FreeBSD.org>1997-11-10 08:03:36 +0000
commit69b3def96447225951a33523a22829bb8d0e21a5 (patch)
treec8d79bc72f1e08b931210c6dc4910813809dc81f /usr.bin/netstat/mbuf.c
parentabc5aa65e1ebea6ac269a42095546af40c503e9f (diff)
downloadFreeBSD-src-69b3def96447225951a33523a22829bb8d0e21a5.zip
FreeBSD-src-69b3def96447225951a33523a22829bb8d0e21a5.tar.gz
Add (unsigned) cast to prevent overflow in %
Submitted by: "Alex G. Bulushev" <bag@demos.su>
Diffstat (limited to 'usr.bin/netstat/mbuf.c')
-rw-r--r--usr.bin/netstat/mbuf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/netstat/mbuf.c b/usr.bin/netstat/mbuf.c
index c8dc88c..f794500 100644
--- a/usr.bin/netstat/mbuf.c
+++ b/usr.bin/netstat/mbuf.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)mbuf.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: mbuf.c,v 1.7 1997/07/29 06:51:40 charnier Exp $";
+ "$Id: mbuf.c,v 1.8 1997/08/17 09:12:43 peter Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -144,7 +144,7 @@ mbpr(mbaddr)
totfree = mbstat.m_clfree * MCLBYTES +
MSIZE * (mbstat.m_mbufs - totmbufs);
printf("%u Kbytes allocated to network (%d%% in use)\n",
- totmem / 1024, (totmem - totfree) * 100 / totmem);
+ totmem / 1024, (unsigned) (totmem - totfree) * 100 / totmem);
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);
OpenPOWER on IntegriCloud