aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarcelo Araujo <araujo@FreeBSD.org>2016-04-18 03:44:42 +0000
committerMarcelo Araujo <araujo@FreeBSD.org>2016-04-18 03:44:42 +0000
commit6a35cae5edbea04de8bcba67df345eaea9138a7b (patch)
treec3913680157407a6e82a3eddb348765263761eb5 /usr.sbin
parent5b3078c3bdac652eaf5e85a9cdc756dcecdddad2 (diff)
downloadsrc-6a35cae5edbea04de8bcba67df345eaea9138a7b.tar.gz
src-6a35cae5edbea04de8bcba67df345eaea9138a7b.zip
Use nitems instead of 'sizeof(mapnames) / sizeof(mapnames[0]'.
Notes
Notes: svn path=/head/; revision=298177
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ypldap/yp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ypldap/yp.c b/usr.sbin/ypldap/yp.c
index 0a1183b534c9..2a78d99abd8e 100644
--- a/usr.sbin/ypldap/yp.c
+++ b/usr.sbin/ypldap/yp.c
@@ -597,14 +597,14 @@ ypproc_maplist_2_svc(domainname *arg, struct svc_req *req)
{ "netid.byname", YPMAP_NETID_BYNAME },
};
static ypresp_maplist res;
- static struct ypmaplist maps[sizeof(mapnames) / sizeof(mapnames[0])];
+ static struct ypmaplist maps[nitems(mapnames)];
if (yp_valid_domain(*arg, (struct ypresp_val *)&res) == -1)
return (&res);
res.stat = YP_TRUE;
res.maps = NULL;
- for (i = 0; i < sizeof(mapnames) / sizeof(mapnames[0]); i++) {
+ for (i = 0; i < nitems(mapnames); i++) {
if (!(env->sc_flags & mapnames[i].cond))
continue;
maps[i].map = mapnames[i].name;