diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-13 03:27:37 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-13 03:27:37 +0000 |
commit | 1ae7e6b6544cf7f79cb306f715db502666538ae4 (patch) | |
tree | b275f26458f913395c8f5ddf2d0762b1d8933888 /encoding.c | |
parent | 771d31ace2e8fb923852cb2a70b18b3c8b4edc69 (diff) |
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.c | 2 |
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; |