summaryrefslogtreecommitdiff
path: root/libstd/intparse.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2013-12-26 02:36:21 -0500
committerOri Bernstein <ori@eigenstate.org>2013-12-26 02:36:21 -0500
commit6dcc346d38d0d9be13802e175707552483ec910e (patch)
tree3845fd04884bee11d2f2c4f7f78001c1052c9bfe /libstd/intparse.myr
parentb0e4641ba0ebc3c6297792d289099eeb9b8975cb (diff)
downloadmc-6dcc346d38d0d9be13802e175707552483ec910e.tar.gz
Fix integer parsing for nondecimal bases.
We forgot to add in 10 for 'a'... Oops.
Diffstat (limited to 'libstd/intparse.myr')
-rw-r--r--libstd/intparse.myr4
1 files changed, 2 insertions, 2 deletions
diff --git a/libstd/intparse.myr b/libstd/intparse.myr
index d763854..cb78763 100644
--- a/libstd/intparse.myr
+++ b/libstd/intparse.myr
@@ -75,9 +75,9 @@ generic charval = {c, base
if c >= '0' && c <= '9'
v = (c - '0') castto(@a::(tcint,tcnum,tctest))
elif c >= 'a' && c <= 'z'
- v = (c - 'a') castto(@a::(tcint,tcnum,tctest))
+ v = (c - 'a' + 10) castto(@a::(tcint,tcnum,tctest))
elif c >= 'A' && c <= 'Z'
- v = (c - 'A') castto(@a::(tcint,tcnum,tctest))
+ v = (c - 'A' + 10) castto(@a::(tcint,tcnum,tctest))
;;
if v < 0 || v > (base castto(@a::(tcint,tcnum,tctest)))