summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/string.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/string.c b/src/string.c
index 38aa6561e..3603d5ac7 100644
--- a/src/string.c
+++ b/src/string.c
@@ -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;