svn commit: r330636 - stable/11/sbin/fsdb
Eitan Adler
eadler at FreeBSD.org
Thu Mar 8 07:16:54 UTC 2018
Author: eadler
Date: Thu Mar 8 07:16:53 2018
New Revision: 330636
URL: https://svnweb.freebsd.org/changeset/base/330636
Log:
MFC r303539:
Use nitems() from sys/param.h.
Modified:
stable/11/sbin/fsdb/fsdb.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sbin/fsdb/fsdb.c
==============================================================================
--- stable/11/sbin/fsdb/fsdb.c Thu Mar 8 07:15:14 2018 (r330635)
+++ stable/11/sbin/fsdb/fsdb.c Thu Mar 8 07:16:53 2018 (r330636)
@@ -900,7 +900,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);
@@ -908,7 +908,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;
More information about the svn-src-stable-11
mailing list