Use u_int64_t to avoid an integer overflow when converting total number

of swap blocks into kilo bytes.
This commit is contained in:
enami 2000-06-09 07:09:28 +00:00
parent 1c2aa78d6b
commit 2eee9d6e1d
1 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: m_netbsd15.c,v 1.6 2000/06/05 05:24:07 simonb Exp $ */
/* $NetBSD: m_netbsd15.c,v 1.7 2000/06/09 07:09:28 enami Exp $ */
/*
* top - a top users display for Unix
@ -34,7 +34,7 @@
* Simon Burge <simonb@netbsd.org>
*
*
* $Id: m_netbsd15.c,v 1.6 2000/06/05 05:24:07 simonb Exp $
* $Id: m_netbsd15.c,v 1.7 2000/06/09 07:09:28 enami Exp $
*/
#include <sys/param.h>
@ -269,7 +269,8 @@ get_system_info(si)
int mib[2];
struct uvmexp uvmexp;
struct swapent *sep, *seporig;
int totalsize, size, totalinuse, inuse, ncounted;
u_int64_t totalsize, totalinuse;
int size, inuse, ncounted;
int rnswap, nswap;
mib[0] = CTL_KERN;