about summary refs log tree commit diff
path: root/src/libexpr/lexer.l
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/lexer.l')
-rw-r--r--src/libexpr/lexer.l6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libexpr/lexer.l b/src/libexpr/lexer.l
index 3b7c6bb57a..76cd372013 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;
             }