summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--mrbgems/mruby-proc-ext/src/proc.c5
-rw-r--r--src/error.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/mrbgems/mruby-proc-ext/src/proc.c b/mrbgems/mruby-proc-ext/src/proc.c
index 34f6230dc..1e033cbfb 100644
--- a/mrbgems/mruby-proc-ext/src/proc.c
+++ b/mrbgems/mruby-proc-ext/src/proc.c
@@ -52,7 +52,10 @@ mrb_proc_inspect(mrb_state *mrb, mrb_value self)
line = mrb_debug_get_line(irep, 0);
if (line != -1) {
- mrb_str_append(mrb, str, mrb_fixnum_value(line));
+ char buf[32];
+
+ snprintf(buf, sizeof(buf), "%"MRB_PRId, line);
+ mrb_str_cat_cstr(mrb, str, buf);
}
else {
mrb_str_cat_lit(mrb, str, "-");
diff --git a/src/error.c b/src/error.c
index 93e90fc69..3ef57f895 100644
--- a/src/error.c
+++ b/src/error.c
@@ -152,7 +152,7 @@ exc_inspect(mrb_state *mrb, mrb_value exc)
char buf[32];
str = mrb_str_dup(mrb, file);
- snprintf(buf, sizeof(buf), ":%d: ", mrb_fixnum(line));
+ snprintf(buf, sizeof(buf), ":%"MRB_PRId": ", mrb_fixnum(line));
mrb_str_cat_cstr(mrb, str, buf);
if (append_mesg) {
mrb_str_cat_str(mrb, str, mesg);