Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/vmstat Check array boundary correctly.



details:   https://anonhg.NetBSD.org/src/rev/b2c8f7c5c528
branches:  trunk
changeset: 517883:b2c8f7c5c528
user:      enami <enami%NetBSD.org@localhost>
date:      Wed Nov 21 00:40:56 2001 +0000

description:
Check array boundary correctly.

diffstat:

 usr.bin/vmstat/vmstat.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 5db4861b3c88 -r b2c8f7c5c528 usr.bin/vmstat/vmstat.c
--- a/usr.bin/vmstat/vmstat.c   Wed Nov 21 00:38:50 2001 +0000
+++ b/usr.bin/vmstat/vmstat.c   Wed Nov 21 00:40:56 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.85 2001/11/21 00:38:50 enami Exp $ */
+/* $NetBSD: vmstat.c,v 1.86 2001/11/21 00:40:56 enami Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -80,7 +80,7 @@
 #if 0
 static char sccsid[] = "@(#)vmstat.c   8.2 (Berkeley) 3/1/95";
 #else
-__RCSID("$NetBSD: vmstat.c,v 1.85 2001/11/21 00:38:50 enami Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.86 2001/11/21 00:40:56 enami Exp $");
 #endif
 #endif /* not lint */
 
@@ -862,8 +862,8 @@
                    34 - (evcnt.ev_grouplen + 1 + evcnt.ev_namelen), "",
                    (unsigned long long)evcnt.ev_count,
                    (unsigned long long)(evcnt.ev_count / uptime),
-                   (evcnt.ev_type < sizeof(evtypes)/sizeof(evtypes)
-                       ? evtypes[evcnt.ev_type] : "?"));
+                   (evcnt.ev_type < sizeof(evtypes)/sizeof(evtypes[0]) ?
+                       evtypes[evcnt.ev_type] : "?"));
        }
 }
 



Home | Main Index | Thread Index | Old Index