aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMarcelo Araujo <araujo@FreeBSD.org>2017-03-10 04:49:40 +0000
committerMarcelo Araujo <araujo@FreeBSD.org>2017-03-10 04:49:40 +0000
commit4e7ecee6338b6cb273202035b6cc6c18ba6f81bd (patch)
treea8948aac5b00149ad7816f1624978379c79d1ce2 /usr.bin
parent807bd0d9f0ea1825d8121be5ebde0a08d1ead238 (diff)
downloadsrc-4e7ecee6338b6cb273202035b6cc6c18ba6f81bd.tar.gz
src-4e7ecee6338b6cb273202035b6cc6c18ba6f81bd.zip
Use nitems() from sys/param.h and also remove the cast.
Reviewed by: markj MFC after: 3 weeks. Differential Revision: https://reviews.freebsd.org/D9937
Notes
Notes: svn path=/head/; revision=314989
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/vmstat/vmstat.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index ffc4fcc6554c..640af527bc4c 100644
--- a/usr.bin/vmstat/vmstat.c
+++ b/usr.bin/vmstat/vmstat.c
@@ -288,17 +288,13 @@ retry_nlist:
namelist[X_SUM].n_name = "_cnt";
goto retry_nlist;
}
- for (c = 0;
- c < (int)(sizeof(namelist)/sizeof(namelist[0]));
- c++)
+ for (c = 0; c < nitems(namelist); c++)
if (namelist[c].n_type == 0)
bufsize += strlen(namelist[c].n_name) + 1;
bufsize += len + 1;
buf = bp = alloca(bufsize);
- for (c = 0;
- c < (int)(sizeof(namelist)/sizeof(namelist[0]));
- c++)
+ for (c = 0; c < nitems(namelist); c++)
if (namelist[c].n_type == 0) {
xo_error(" %s",
namelist[c].n_name);