transcode.c: fill terminator

* transcode.c (str_encode_associate): fill terminator after conversion.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-07-11 11:18:10 +00:00
parent 1549894a06
commit 18030d18cf
4 changed files with 15 additions and 1 deletions

View file

@ -1539,6 +1539,16 @@ rb_string_value_cstr(volatile VALUE *ptr)
return s;
}
void
rb_str_fill_terminator(VALUE str)
{
char *s = RSTRING_PTR(str);
long len = RSTRING_LEN(str);
rb_encoding *enc = rb_enc_get(str);
const int minlen = rb_enc_mbminlen(enc);
str_fill_term(str, s, len, minlen, enc);
}
VALUE
rb_check_string_type(VALUE str)
{