From 1068140988c8614781c7e3e36e4a515b9a7cbfb7 Mon Sep 17 00:00:00 2001 From: Marcelo Araujo Date: Tue, 19 Apr 2016 06:34:31 +0000 Subject: [PATCH] Use nitems() from sys/param.h. MFC after: 2 weeks. --- sbin/ping6/ping6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c index 7e1719ae5155..5cbc77c3e97d 100644 --- a/sbin/ping6/ping6.c +++ b/sbin/ping6/ping6.c @@ -2495,7 +2495,7 @@ pr_icmph(struct icmp6_hdr *icp, u_char *end) break; } if (options & F_VERBOSE) { - if (ni->ni_code > sizeof(nircode) / sizeof(nircode[0])) + if (ni->ni_code > nitems(nircode)) printf(", invalid"); else printf(", %s", nircode[ni->ni_code]);