1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

Add (unsigned) cast to prevent overflow in %

Submitted by:  "Alex G. Bulushev" <bag@demos.su>
This commit is contained in:
Andrey A. Chernov 1997-11-10 08:03:36 +00:00
parent 19c6c94322
commit 881377bc7d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=31097

View File

@ -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);