Skip to content

Commit b3626b3

Browse files
committed
string.c: expand heap
* string.c (str_buf_cat): expand the heap buffer at making str independent, not only just copying. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent b885823 commit b3626b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

string.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2194,7 +2194,7 @@ str_buf_cat(VALUE str, const char *ptr, long len)
21942194
if (ptr >= sptr && ptr <= sptr + olen) {
21952195
off = ptr - sptr;
21962196
}
2197-
rb_str_modify(str);
2197+
rb_str_modify_expand(str, len);
21982198
if (len == 0) return 0;
21992199
if (STR_EMBED_P(str)) {
22002200
capa = RSTRING_EMBED_LEN_MAX;

0 commit comments

Comments
 (0)