Skip to content

Commit

Permalink
scanner.l: fix yyerror() call to take the right number of arguments.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tcort committed Feb 22, 2015
1 parent 4acdf07 commit 5ff9c48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include "parser.h"

int yyerror(char *);
int yyerror(void *, char *);
%}

%option reentrant
Expand Down Expand Up @@ -83,11 +83,11 @@ int yyerror(char *);
}

. {
yyerror("Unknown character");
yyerror(yyscanner, "Unknown character");
}

%%

int yywrap(yyscan_t yyscanner) {
int yywrap(void *yyscanner) {
return 1;
}

0 comments on commit 5ff9c48

Please sign in to comment.