Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/top/machine Use u_int64_t to avoid an integer overfl...



details:   https://anonhg.NetBSD.org/src/rev/3b11c20557a4
branches:  trunk
changeset: 487560:3b11c20557a4
user:      enami <enami%NetBSD.org@localhost>
date:      Fri Jun 09 07:09:28 2000 +0000

description:
Use u_int64_t to avoid an integer overflow when converting total number
of swap blocks into kilo bytes.

diffstat:

 usr.bin/top/machine/m_netbsd15.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 373ba017a8d1 -r 3b11c20557a4 usr.bin/top/machine/m_netbsd15.c
--- a/usr.bin/top/machine/m_netbsd15.c  Fri Jun 09 06:30:35 2000 +0000
+++ b/usr.bin/top/machine/m_netbsd15.c  Fri Jun 09 07:09:28 2000 +0000
@@ -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@localhost>
  *
  *
- * $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 @@
        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;



Home | Main Index | Thread Index | Old Index