summaryrefslogtreecommitdiff
path: root/parse/tok.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-06-03 21:57:57 -0400
committerOri Bernstein <ori@eigenstate.org>2014-06-03 21:57:57 -0400
commit6007029a7fcb1184f5f3d698ed55f96fa4812ac1 (patch)
treecfed54fe28357f2cc60fc45e20c76ab3b58fb82f /parse/tok.c
parente29ec974f6737e8c51d8fd0fea306c1fa6c0ece0 (diff)
downloadmc-6007029a7fcb1184f5f3d698ed55f96fa4812ac1.tar.gz
Allow integer parsing to work with large integers.
We used to fail when we were out of the range of strtol. strtoull is what we want to use, since the integer format is guaranteed to be unsigned. Unary '-' is applied elsewhere, as are range checks.
Diffstat (limited to 'parse/tok.c')
-rw-r--r--parse/tok.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse/tok.c b/parse/tok.c
index c36eeec..07405a5 100644
--- a/parse/tok.c
+++ b/parse/tok.c
@@ -646,7 +646,7 @@ static Tok *number(int base)
} else {
t = mktok(Tintlit);
t->str = strdupn(&fbuf[start], fidx - start);
- t->intval = strtol(t->str, NULL, base);
+ t->intval = strtoull(t->str, NULL, base);
/* check suffixes:
* u -> unsigned
* l -> 64 bit