mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
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:
parent
1549894a06
commit
18030d18cf
4 changed files with 15 additions and 1 deletions
10
string.c
10
string.c
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue