]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fixes parsing larger numbers on 64bit platforms.
authorOndrej Zajicek <santiago@crfreenet.org>
Thu, 22 Dec 2011 12:44:43 +0000 (13:44 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Thu, 22 Dec 2011 12:44:43 +0000 (13:44 +0100)
conf/cf-lex.l

index a43f9eb942db0596575e875ba7949b957dfbf095..408fa93a119a8097c2e208313df48c67ccd7ce83 100644 (file)
@@ -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;