diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-06-25 20:45:44 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-06-25 20:45:44 +0000 |
commit | 429f9268a4fee3d872a0b78ec118e0bb0843d87a (patch) | |
tree | 13f451b683e200c1690eb907b65503afd20dbd66 | |
parent | c9e88c5e7ee535e86b97a3bdab695c6ad74b796e (diff) |
the rule is not to use nitems() in userland yet
-rw-r--r-- | usr.bin/systat/main.c | 4 | ||||
-rw-r--r-- | usr.bin/systat/sensors.c | 4 |
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; } |