svn commit: r298177 - head/usr.sbin/ypldap
Marcelo Araujo
araujo at FreeBSD.org
Mon Apr 18 03:44:43 UTC 2016
Author: araujo
Date: Mon Apr 18 03:44:42 2016
New Revision: 298177
URL: https://svnweb.freebsd.org/changeset/base/298177
Log:
Use nitems instead of 'sizeof(mapnames) / sizeof(mapnames[0]'.
Modified:
head/usr.sbin/ypldap/yp.c
Modified: head/usr.sbin/ypldap/yp.c
==============================================================================
--- head/usr.sbin/ypldap/yp.c Mon Apr 18 02:36:49 2016 (r298176)
+++ head/usr.sbin/ypldap/yp.c Mon Apr 18 03:44:42 2016 (r298177)
@@ -597,14 +597,14 @@ ypproc_maplist_2_svc(domainname *arg, st
{ "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;
More information about the svn-src-head
mailing list