summaryrefslogtreecommitdiffhomepage
path: root/src/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/string.c b/src/string.c
index 38aa6561e..79606f1af 100644
--- a/src/string.c
+++ b/src/string.c
@@ -2137,7 +2137,7 @@ mrb_str_len_to_inum(mrb_state *mrb, const char *str, size_t len, int base, int b
}
c = *p;
if (badcheck && c == '\0') {
- goto nullbyte;
+ goto bad;
}
c = conv_digit(c);
if (c < 0 || c >= base) {
@@ -2163,7 +2163,8 @@ mrb_str_len_to_inum(mrb_state *mrb, const char *str, size_t len, int base, int b
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));
+ mrb_raisef(mrb, E_ARGUMENT_ERROR, "string (%S) too big for integer",
+ mrb_str_new(mrb, str, pend-str));
}
}
val = n;