From 67db7b43d07e9b29564f6b4734f8d2e975cc805c Mon Sep 17 00:00:00 2001 From: Elyes Haouas Date: Tue, 7 Nov 2023 18:13:19 +0100 Subject: [PATCH] ppp: 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 --- usr.sbin/ppp/chat.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/ppp/chat.h b/usr.sbin/ppp/chat.h index 54e86834be6..c8fcf9a9c3c 100644 --- a/usr.sbin/ppp/chat.h +++ b/usr.sbin/ppp/chat.h @@ -26,6 +26,8 @@ * SUCH DAMAGE. */ +#include + #define CHAT_EXPECT 0 #define CHAT_SEND 1 #define CHAT_DONE 2 @@ -74,7 +76,7 @@ struct chat { #define descriptor2chat(d) \ ((d)->type == CHAT_DESCRIPTOR ? (struct chat *)(d) : NULL) -#define VECSIZE(v) (sizeof(v) / sizeof(v[0])) +#define VECSIZE(v) nitems(v) extern void chat_Init(struct chat *, struct physical *); extern int chat_Setup(struct chat *, const char *, const char *);