From 1997420a7f7fce627091c9046dca118f5e6697c0 Mon Sep 17 00:00:00 2001 From: take_cheeze Date: Fri, 13 Jun 2014 17:42:43 +0900 Subject: Fix raise format found with mruby-clang-plugin. --- src/pack.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/pack.c') diff --git a/src/pack.c b/src/pack.c index f130767ac..3e56454f2 100644 --- a/src/pack.c +++ b/src/pack.c @@ -665,7 +665,8 @@ read_tmpl(mrb_state *mrb, struct tmpl *tmpl, int *dirp, int *typep, int *sizep, count = -1; } else if (ch == '_' || ch == '!' || ch == '<' || ch == '>') { if (strchr("sSiIlL", t) == NULL) { - mrb_raisef(mrb, E_ARGUMENT_ERROR, "'%c' allowed only after types sSiIlL", ch); + char ch_str = ch; + mrb_raisef(mrb, E_ARGUMENT_ERROR, "'%S' allowed only after types sSiIlL", mrb_str_new(mrb, &ch_str, 1)); } if (ch == '_' || ch == '!') { flags |= PACK_FLAG_s; @@ -721,7 +722,7 @@ mrb_pack_pack(mrb_state *mrb, mrb_value ary) if (mrb_float_p(o)) { o = mrb_funcall(mrb, o, "to_i", 0); } else if (!mrb_fixnum_p(o)) { - mrb_raisef(mrb, E_TYPE_ERROR, "can't convert %s into Integer", mrb_obj_classname(mrb, o)); + mrb_raisef(mrb, E_TYPE_ERROR, "can't convert %S into Integer", mrb_class_path(mrb, mrb_obj_class(mrb, o))); } } else if (type == PACK_TYPE_FLOAT) { if (!mrb_float_p(o)) { @@ -729,7 +730,7 @@ mrb_pack_pack(mrb_state *mrb, mrb_value ary) } } else if (type == PACK_TYPE_STRING) { if (!mrb_string_p(o)) { - mrb_raisef(mrb, E_TYPE_ERROR, "can't convert %s into String", mrb_obj_classname(mrb, o)); + mrb_raisef(mrb, E_TYPE_ERROR, "can't convert %S into String", mrb_class_path(mrb, mrb_obj_class(mrb, o))); } } -- cgit v1.2.3