summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-proc-ext/src/proc.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-03-19 20:41:51 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-03-19 20:43:25 +0900
commitef105b5ca41018f30c38f9738d5b54c4aa0fe6e4 (patch)
tree14f8db4ca553494a7cc27f187f834bdab55463ff /mrbgems/mruby-proc-ext/src/proc.c
parent4cf38eb9032ab70544f940941703a0c09529539f (diff)
downloadmruby-ef105b5ca41018f30c38f9738d5b54c4aa0fe6e4.tar.gz
mruby-ef105b5ca41018f30c38f9738d5b54c4aa0fe6e4.zip
Use MRB_PRId instead of "%d"; fix #3515
Diffstat (limited to 'mrbgems/mruby-proc-ext/src/proc.c')
-rw-r--r--mrbgems/mruby-proc-ext/src/proc.c5
1 files changed, 4 insertions, 1 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, "-");