summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--mrbgems/mruby-sprintf/src/sprintf.c2
-rw-r--r--src/string.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/mrbgems/mruby-sprintf/src/sprintf.c b/mrbgems/mruby-sprintf/src/sprintf.c
index de216f69f..81b48b10d 100644
--- a/mrbgems/mruby-sprintf/src/sprintf.c
+++ b/mrbgems/mruby-sprintf/src/sprintf.c
@@ -73,7 +73,7 @@ mrb_fix2binstr(mrb_state *mrb, mrb_value x, int base)
{
char buf[64], *b = buf + sizeof buf;
mrb_int num = mrb_fixnum(x);
- unsigned long val = (unsigned long)num;
+ uint64_t val = (uint64_t)num;
char d;
if (base != 2) {
diff --git a/src/string.c b/src/string.c
index 73ef341bb..08caf3bae 100644
--- a/src/string.c
+++ b/src/string.c
@@ -1863,7 +1863,7 @@ mrb_cstr_to_inum(mrb_state *mrb, const char *str, int base, int badcheck)
const char *p;
char sign = 1;
int c, uscore;
- unsigned long n = 0;
+ uint64_t n = 0;
mrb_int val;
#define conv_digit(c) \
@@ -1983,9 +1983,9 @@ mrb_cstr_to_inum(mrb_state *mrb, const char *str, int base, int badcheck)
}
n *= base;
n += c;
- }
- if (n > MRB_INT_MAX) {
- mrb_raisef(mrb, E_ARGUMENT_ERROR, "string (%S) too big for integer", mrb_str_new_cstr(mrb, str));
+ if (n > MRB_INT_MAX) {
+ mrb_raisef(mrb, E_ARGUMENT_ERROR, "string (%S) too big for integer", mrb_str_new_cstr(mrb, str));
+ }
}
val = n;
if (badcheck) {