aboutsummaryrefslogtreecommitdiff
path: root/sbin/ipf/common/lexer.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/ipf/common/lexer.c')
-rw-r--r--sbin/ipf/common/lexer.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/ipf/common/lexer.c b/sbin/ipf/common/lexer.c
index 5a898c72032d..56ac3586af6e 100644
--- a/sbin/ipf/common/lexer.c
+++ b/sbin/ipf/common/lexer.c
@@ -10,6 +10,7 @@
# include "netinet/ip_scan.h"
#endif
#include <sys/ioctl.h>
+#include <sys/param.h>
#include <syslog.h>
#ifdef TEST_LEXER
# define NO_YACC
@@ -448,7 +449,7 @@ buildipv6:
oc = c;
if (prior == YY_NUMBER && c == ':') {
- snprintf(s, sizeof(s), "%d", priornum);
+ snprintf(s, sizeof(ipv6buf), "%d", priornum);
s += strlen(s);
}
@@ -675,7 +676,7 @@ yysetfixeddict(wordtab_t *newdict)
if (yydebug)
printf("yysetfixeddict(%lx)\n", (u_long)newdict);
- if (yysavedepth == sizeof(yysavewords)/sizeof(yysavewords[0])) {
+ if (yysavedepth == nitems(yysavewords)) {
fprintf(stderr, "%d: at maximum dictionary depth\n",
yylineNum);
return;
@@ -694,7 +695,7 @@ yysetdict(wordtab_t *newdict)
if (yydebug)
printf("yysetdict(%lx)\n", (u_long)newdict);
- if (yysavedepth == sizeof(yysavewords)/sizeof(yysavewords[0])) {
+ if (yysavedepth == nitems(yysavewords)) {
fprintf(stderr, "%d: at maximum dictionary depth\n",
yylineNum);
return;