summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-11 20:36:18 (GMT)
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-11 20:36:18 (GMT)
commitbc8dfdc05960c730c9ade7a336226e5520f11235 (patch)
tree7cd43371ae77d38b7ad71e13f7d17d6f97309a82 /rational.c
parent731c9288dab654a31e7ccbaf57072ff66c00cdf8 (diff)
rational.c: preserve encoding in exception
* rational.c (string_to_r_strict): preserve encoding in exception git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/rational.c b/rational.c
index 2d0daea..0f3167a 100644
--- a/rational.c
+++ b/rational.c
@@ -2327,9 +2327,8 @@ string_to_r_strict(VALUE self)
s = (char *)"";
if (!parse_rat(s, 1, &num)) {
- VALUE ins = f_inspect(self);
- rb_raise(rb_eArgError, "invalid value for convert(): %s",
- StringValuePtr(ins));
+ rb_raise(rb_eArgError, "invalid value for convert(): %+"PRIsVALUE,
+ self);
}
if (RB_TYPE_P(num, T_FLOAT))