aboutsummaryrefslogtreecommitdiffstats
path: root/encoding.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-13 03:27:37 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-13 03:27:37 +0000
commit1ae7e6b6544cf7f79cb306f715db502666538ae4 (patch)
treeb275f26458f913395c8f5ddf2d0762b1d8933888 /encoding.c
parent771d31ace2e8fb923852cb2a70b18b3c8b4edc69 (diff)
downloadruby-1ae7e6b6544cf7f79cb306f715db502666538ae4.tar.gz
encoding.c: new termlen not oldtermlen
* encoding.c (rb_enc_associate_index): fill new terminator length, not old one. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'encoding.c')
-rw-r--r--encoding.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/encoding.c b/encoding.c
index 7c64248d12..6e0777d24c 100644
--- a/encoding.c
+++ b/encoding.c
@@ -795,7 +795,7 @@ rb_enc_associate_index(VALUE obj, int idx)
termlen = rb_enc_mbminlen(enc);
oldtermlen = rb_enc_mbminlen(rb_enc_from_index(oldidx));
if (oldtermlen < termlen && RB_TYPE_P(obj, T_STRING)) {
- rb_str_fill_terminator(obj, oldtermlen);
+ rb_str_fill_terminator(obj, termlen);
}
enc_set_index(obj, idx);
return obj;