summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/systat/main.c4
-rw-r--r--usr.bin/systat/sensors.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c
index 14d93b8334b..b83ac6d8a2b 100644
--- a/usr.bin/systat/main.c
+++ b/usr.bin/systat/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.53 2009/06/25 20:39:02 okan Exp $ */
+/* $Id: main.c,v 1.54 2009/06/25 20:45:43 deraadt Exp $ */
/*
* Copyright (c) 2001, 2007 Can Erkin Acar
* Copyright (c) 2001 Daniel Hartmeier
@@ -97,7 +97,7 @@ print_header(void)
tb_start();
- getloadavg(avenrun, nitems(avenrun));
+ getloadavg(avenrun, sizeof(avenrun) / sizeof(avenrun[0]));
time(&now);
strlcpy(tbuf, ctime(&now), sizeof tbuf);
diff --git a/usr.bin/systat/sensors.c b/usr.bin/systat/sensors.c
index 4469f58ca65..33d02608f89 100644
--- a/usr.bin/systat/sensors.c
+++ b/usr.bin/systat/sensors.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sensors.c,v 1.16 2009/06/25 20:40:33 okan Exp $ */
+/* $OpenBSD: sensors.c,v 1.17 2009/06/25 20:45:43 deraadt Exp $ */
/*
* Copyright (c) 2007 Deanna Phillips <deanna@openbsd.org>
@@ -244,7 +244,7 @@ showsensor(struct sensinfo *s)
break;
case SENSOR_DRIVE:
if (0 < s->sn_value &&
- s->sn_value < nitems(drvstat)) {
+ s->sn_value < sizeof(drvstat)/sizeof(drvstat[0])) {
tbprintf("%15s", drvstat[s->sn_value]);
break;
}