From 6a35cae5edbea04de8bcba67df345eaea9138a7b Mon Sep 17 00:00:00 2001 From: Marcelo Araujo Date: Mon, 18 Apr 2016 03:44:42 +0000 Subject: [PATCH] Use nitems instead of 'sizeof(mapnames) / sizeof(mapnames[0]'. --- usr.sbin/ypldap/yp.c | 4 ++-- 1 file 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;