string.c: term fill

* string.c (rb_str_plus): fill wchar terminator.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-12-10 07:48:34 +00:00
parent b890ed926a
commit c00aca4aa0

View File

@ -1455,7 +1455,7 @@ rb_str_plus(VALUE str1, VALUE str2)
ptr3 = RSTRING_PTR(str3);
memcpy(ptr3, ptr1, len1);
memcpy(ptr3+len1, ptr2, len2);
ptr3[len1+len2] = '\0';
TERM_FILL(&ptr3[len1+len2], rb_enc_mbminlen(enc));
if (OBJ_TAINTED(str1) || OBJ_TAINTED(str2))
OBJ_TAINT(str3);