summaryrefslogtreecommitdiffhomepage
path: root/src/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/string.c b/src/string.c
index 183763bf2..dc7fdfae8 100644
--- a/src/string.c
+++ b/src/string.c
@@ -3843,6 +3843,7 @@ mrb_cstr_to_inum(mrb_state *mrb, const char *str, int base, int badcheck)
// long i;
// mrb_value z;
// BDIGIT *zds;
+ unsigned long val;
#undef ISDIGIT
#define ISDIGIT(c) ('0' <= (c) && (c) <= '9')
@@ -3958,7 +3959,7 @@ mrb_cstr_to_inum(mrb_state *mrb, const char *str, int base, int badcheck)
}
len *= strlen(str)*sizeof(char);
- unsigned long val = strtoul((char*)str, &end, base);
+ val = strtoul((char*)str, &end, base);
if (badcheck) {
if (end == str) goto bad; /* no number */