Date: Mon, 18 Apr 2016 03:44:42 +0000 (UTC) From: Marcelo Araujo <araujo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298177 - head/usr.sbin/ypldap Message-ID: <201604180344.u3I3igvm091082@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604180344.u3I3igvm091082>