summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-10 12:09:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-10 12:09:49 +0000
commit117438ee7bb5fc99423cec201f804da540e340b8 (patch)
treeb75bc2f4786a1361dc36bfd19ba3f97e91352e1f /string.c
parent9d170963098fea8e11196cee155ca448bfc01fb3 (diff)
string.c: term fill
* string.c (rb_str_sub_bang): fill wchar terminator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index 49e3c18152..2fb67efe92 100644
--- a/string.c
+++ b/string.c
@@ -4158,7 +4158,7 @@ rb_str_sub_bang(int argc, VALUE *argv, VALUE str)
memcpy(p + beg0, rp, rlen);
len += rlen - plen;
STR_SET_LEN(str, len);
- RSTRING_PTR(str)[len] = '\0';
+ TERM_FILL(&RSTRING_PTR(str)[len], TERM_LEN(str));
ENC_CODERANGE_SET(str, cr);
if (tainted) OBJ_TAINT(str);