git: cbfd42cc07cc - main - wlandebug: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

From: Warner Losh <imp_at_FreeBSD.org>
Date: Mon, 29 Apr 2024 04:27:26 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=cbfd42cc07cc1b684a1d512e1265a1cd5e47e677

commit cbfd42cc07cc1b684a1d512e1265a1cd5e47e677
Author:     Elyes Haouas <ehaouas@noos.fr>
AuthorDate: 2023-11-07 17:14:34 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-04-29 03:30:55 +0000

    wlandebug: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
    
    Pull Request: https://github.com/freebsd/freebsd-src/pull/888
    Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
---
 usr.sbin/wlandebug/wlandebug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/usr.sbin/wlandebug/wlandebug.c b/usr.sbin/wlandebug/wlandebug.c
index b44d82d8dd1d..b086de94eb2a 100644
--- a/usr.sbin/wlandebug/wlandebug.c
+++ b/usr.sbin/wlandebug/wlandebug.c
@@ -33,7 +33,7 @@
  * wlandebug [-i interface] flags
  * (default interface is wlan.0).
  */
-#include <sys/types.h>
+#include <sys/param.h>
 #include <sys/sysctl.h>
 
 #include <net/if.h>
@@ -47,7 +47,7 @@
 
 #include <libifconfig.h>
 
-#define	N(a)	(sizeof(a)/sizeof(a[0]))
+#define	N(a)	nitems(a)
 
 const char *progname;