Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Mar 2018 07:16:53 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r330636 - stable/11/sbin/fsdb
Message-ID:  <201803080716.w287GrN6055013@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803080716.w287GrN6055013>