From 02c8c1182bb82e98da00fae3539aef0b9ca952fb Mon Sep 17 00:00:00 2001 From: Marcelo Araujo Date: Sat, 30 Jul 2016 06:19:34 +0000 Subject: Use nitems() from sys/param.h. Sponsored by: gandi.net (BSD Day Taiwan) --- sbin/fsdb/fsdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sbin/fsdb') diff --git a/sbin/fsdb/fsdb.c b/sbin/fsdb/fsdb.c index 1315aeca0acb..b35a06775452 100644 --- a/sbin/fsdb/fsdb.c +++ b/sbin/fsdb/fsdb.c @@ -898,7 +898,7 @@ CMDFUNCSTART(newtype) return 1; type = DIP(curinode, di_mode) & IFMT; for (tp = typenamemap; - tp < &typenamemap[sizeof(typenamemap)/sizeof(*typenamemap)]; + tp < &typenamemap[nitems(typenamemap)]; tp++) { if (!strcmp(argv[1], tp->typename)) { printf("setting type to %s\n", tp->typename); @@ -906,7 +906,7 @@ CMDFUNCSTART(newtype) break; } } - if (tp == &typenamemap[sizeof(typenamemap)/sizeof(*typenamemap)]) { + if (tp == &typenamemap[nitems(typenamemap)]) { warnx("type `%s' not known", argv[1]); warnx("try one of `file', `dir', `socket', `fifo'"); return 1; -- cgit v1.2.3