summaryrefslogtreecommitdiffhomepage
path: root/src/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/error.c')
-rw-r--r--src/error.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/error.c b/src/error.c
index 062282719..cd771dc2d 100644
--- a/src/error.c
+++ b/src/error.c
@@ -269,9 +269,12 @@ mrb_vformat(mrb_state *mrb, const char *format, va_list ap)
if (c == '%') {
if (*p == 'S') {
+ mrb_value val;
+
size = p - b - 1;
mrb_ary_push(mrb, ary, mrb_str_new(mrb, b, size));
- mrb_ary_push(mrb, ary, va_arg(ap, mrb_value));
+ val = va_arg(ap, mrb_value);
+ mrb_ary_push(mrb, ary, mrb_obj_as_string(mrb, val));
b = p + 1;
}
}