Skip to content

Commit

Permalink
Use MRB_PRId instead of "%d"; fix #3515
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Mar 19, 2017
1 parent 4cf38eb commit ef105b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion mrbgems/mruby-proc-ext/src/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, "-");
Expand Down
2 changes: 1 addition & 1 deletion src/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ef105b5

Please sign in to comment.