summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2011-12-22 13:44:43 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2011-12-22 13:44:43 +0100
commitc32c3f88f0c8788118ed3701c11a5aea2aaf9356 (patch)
tree87e1c717fffa0235023d77004aa628228a68f97c
parentbe4cd99a3688cef19f66e1c8b8e0506ffc1e13fc (diff)
downloadbird-master.tar
bird-master.zip
Fixes parsing larger numbers on 64bit platforms.HEADmaster
-rw-r--r--conf/cf-lex.l8
1 files changed, 4 insertions, 4 deletions
diff --git a/conf/cf-lex.l b/conf/cf-lex.l
index a43f9eb..408fa93 100644
--- a/conf/cf-lex.l
+++ b/conf/cf-lex.l
@@ -129,10 +129,10 @@ include ^{WHITE}*include{WHITE}*\".*\"{WHITE}*;
0x{XIGIT}+ {
char *e;
- long int l;
+ unsigned long int l;
errno = 0;
l = strtoul(yytext+2, &e, 16);
- if (e && *e || errno == ERANGE || (long int)(int) l != l)
+ if (e && *e || errno == ERANGE || (unsigned long int)(unsigned int) l != l)
cf_error("Number out of range");
cf_lval.i = l;
return NUM;
@@ -140,10 +140,10 @@ include ^{WHITE}*include{WHITE}*\".*\"{WHITE}*;
{DIGIT}+ {
char *e;
- long int l;
+ unsigned long int l;
errno = 0;
l = strtoul(yytext, &e, 10);
- if (e && *e || errno == ERANGE || (long int)(int) l != l)
+ if (e && *e || errno == ERANGE || (unsigned long int)(unsigned int) l != l)
cf_error("Number out of range");
cf_lval.i = l;
return NUM;