summaryrefslogtreecommitdiff
path: root/sprintf.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-12 19:29:18 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-02-12 19:58:22 +0900
commitbdf3032e3542b318c6f52dbe20d1c97cca3d7067 (patch)
tree6923498ebb1907e78207edaad7f2e143e0fc31ee /sprintf.c
parent1b219f1fb26d15d69d4a0cb628f856f6f850eac5 (diff)
Make temporary lock string encoding free
As a temporary lock string is hidden, it can not have instance variables, including non-inlined encoding index.
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 64cfdee..ff1800e 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -257,7 +257,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
blen = 0;
bsiz = 120;
result = rb_str_buf_new(bsiz);
- rb_enc_copy(result, fmt);
+ rb_enc_associate(result, enc);
buf = RSTRING_PTR(result);
memset(buf, 0, bsiz);
ENC_CODERANGE_SET(result, coderange);