aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElyes Haouas <ehaouas@noos.fr>2023-11-07 17:13:19 +0000
committerWarner Losh <imp@FreeBSD.org>2024-04-29 03:30:55 +0000
commit67db7b43d07e9b29564f6b4734f8d2e975cc805c (patch)
tree85a433e76c1d19785a999b7bd6923b87b14a4fe8
parentbccbb2fc4bce6c3efc1ba93f222de320db8e020a (diff)
downloadsrc-67db7b43d07e9b29564f6b4734f8d2e975cc805c.tar.gz
src-67db7b43d07e9b29564f6b4734f8d2e975cc805c.zip
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 <ehaouas@noos.fr>
-rw-r--r--usr.sbin/ppp/chat.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/ppp/chat.h b/usr.sbin/ppp/chat.h
index 54e86834be60..c8fcf9a9c3cc 100644
--- a/usr.sbin/ppp/chat.h
+++ b/usr.sbin/ppp/chat.h
@@ -26,6 +26,8 @@
* SUCH DAMAGE.
*/
+#include <sys/param.h>
+
#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 *);