aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/preproc/pgc.l
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg/preproc/pgc.l')
-rw-r--r--src/interfaces/ecpg/preproc/pgc.l10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l
index ba1798c77eb..405dee73b03 100644
--- a/src/interfaces/ecpg/preproc/pgc.l
+++ b/src/interfaces/ecpg/preproc/pgc.l
@@ -21,6 +21,8 @@
#include <ctype.h>
#include <limits.h>
+#include "common/string.h"
+
#include "extern.h"
#include "preproc.h"
}
@@ -727,14 +729,12 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
return PARAM;
}
<C,SQL>{integer} {
- long val;
+ int val;
char* endptr;
errno = 0;
- val = strtol((char *)yytext, &endptr,10);
- if (*endptr != '\0' || errno == ERANGE ||
- /* check for overflow of int */
- val != (int) val)
+ val = strtoint(yytext, &endptr, 10);
+ if (*endptr != '\0' || errno == ERANGE)
{
errno = 0;
base_yylval.str = mm_strdup(yytext);