summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-13 03:03:20 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-13 03:03:20 +0000
commitf7020b1b423ed50c9c56bed991fa0115618f2d27 (patch)
tree0b865d3bd066664d7f427cde5a48045c38178fd7 /sprintf.c
parent54b61b8da5ba7fbc0d5a605a19dd66b75dd7b600 (diff)
revert r24507. [ruby-dev:39073]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sprintf.c')
-rw-r--r--sprintf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sprintf.c b/sprintf.c
index 4a37ecb..11f97e5 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -677,7 +677,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
(cr == ENC_CODERANGE_UNKNOWN ?
ENC_CODERANGE_BROKEN : (coderange = cr)));
}
- enc = rb_enc_check((RSTRING_LEN(result) == 0 ? fmt : result), str);
+ enc = rb_enc_check(result, str);
if (flags&(FPREC|FWIDTH)) {
slen = rb_enc_strlen(RSTRING_PTR(str),RSTRING_END(str),enc);
if (slen < 0) {