diff options
Diffstat (limited to 'src/libexpr/lexer.l')
-rw-r--r-- | src/libexpr/lexer.l | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libexpr/lexer.l b/src/libexpr/lexer.l index 3b7c6bb57a06..76cd372013a5 100644 --- a/src/libexpr/lexer.l +++ b/src/libexpr/lexer.l @@ -110,8 +110,10 @@ or { return OR_KW; } \+\+ { return CONCAT; } {ID} { yylval->id = strdup(yytext); return ID; } -{INT} { int n = atoi(yytext); /* !!! overflow */ - yylval->n = n; +{INT} { errno = 0; + yylval->n = strtol(yytext, 0, 10); + if (errno != 0) + throw ParseError(format("invalid integer `%1%'") % yytext); return INT; } |