aboutsummaryrefslogtreecommitdiffstats
path: root/encoding.c
diff options
context:
space:
mode:
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;