Skip to content

Commit 5ff9c48

Browse files
committed
scanner.l: fix yyerror() call to take the right number of arguments.
When making the parser re-entrant, a second argument was added, but this call was not updated to use 2 arguments. This resulted in a crash on invalid character input.
1 parent 4acdf07 commit 5ff9c48

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scanner.l

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
#include "parser.h"
2525

26-
int yyerror(char *);
26+
int yyerror(void *, char *);
2727
%}
2828

2929
%option reentrant
@@ -83,11 +83,11 @@ int yyerror(char *);
8383
}
8484

8585
. {
86-
yyerror("Unknown character");
86+
yyerror(yyscanner, "Unknown character");
8787
}
8888

8989
%%
9090

91-
int yywrap(yyscan_t yyscanner) {
91+
int yywrap(void *yyscanner) {
9292
return 1;
9393
}

0 commit comments

Comments
 (0)