diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2009-06-25 20:39:03 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2009-06-25 20:39:03 +0000 |
commit | f52d042016ceaf049a55894ed50c44b84b16e308 (patch) | |
tree | 74762d9817bc7641e729aaaff81cc0f86fcb4cad | |
parent | 520215f062a3454a24d3ba2cb4f7d3df39affff7 (diff) |
use the nitems() macro where appropriate
ok canacar@
-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 0b25ab1a10a..14d93b8334b 100644 --- a/usr.bin/systat/main.c +++ b/usr.bin/systat/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.52 2009/06/19 07:48:45 jasper Exp $ */ +/* $Id: main.c,v 1.53 2009/06/25 20:39:02 okan Exp $ */ /* * Copyright (c) 2001, 2007 Can Erkin Acar * Copyright (c) 2001 Daniel Hartmeier @@ -97,7 +97,7 @@ print_header(void) tb_start(); - getloadavg(avenrun, sizeof(avenrun) / sizeof(avenrun[0])); + getloadavg(avenrun, nitems(avenrun)); time(&now); strlcpy(tbuf, ctime(&now), sizeof tbuf); diff --git a/usr.bin/systat/sensors.c b/usr.bin/systat/sensors.c index d12c0dbd644..8280fe68976 100644 --- a/usr.bin/systat/sensors.c +++ b/usr.bin/systat/sensors.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sensors.c,v 1.14 2008/12/07 02:56:06 canacar Exp $ */ +/* $OpenBSD: sensors.c,v 1.15 2009/06/25 20:39:02 okan 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 < sizeof(drvstat)/sizeof(drvstat[0])) { + s->sn_value < nitems(drvstat)) { tbprintf("%15s", drvstat[s->sn_value]); break; } |