diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-11 23:48:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-01-11 23:48:10 +0000 |
commit | 4d69e03b667df09ecf1add84e6e148d26e289b80 (patch) | |
tree | 2aef19abbb85c4bfb880c4978c5d72b5e3722676 /array.c | |
parent | cb95d38a7ab559483b99a8276717ded137d2d1f8 (diff) | |
download | ruby-4d69e03b667df09ecf1add84e6e148d26e289b80.tar.gz |
array.c: class name encoding
* array.c (rb_ary_bsearch): preserve encoding of class name in an
exception message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -2615,15 +2615,15 @@ rb_ary_bsearch(VALUE ary) else if (rb_obj_is_kind_of(v, rb_cNumeric)) { const VALUE zero = INT2FIX(0); switch (rb_cmpint(rb_funcallv(v, id_cmp, 1, &zero), v, INT2FIX(0))) { - case 0: return val; - case 1: smaller = 1; break; - case -1: smaller = 0; + case 0: return val; + case 1: smaller = 1; break; + case -1: smaller = 0; } } else { - rb_raise(rb_eTypeError, "wrong argument type %s" - " (must be numeric, true, false or nil)", - rb_obj_classname(v)); + rb_raise(rb_eTypeError, "wrong argument type %"PRIsVALUE + " (must be numeric, true, false or nil)", + rb_obj_class(v)); } if (smaller) { high = mid; |