diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-04 17:31:09 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-08-04 17:31:09 +0000 |
commit | 7eb5352e24393201fa259bf85de2d84507039d68 (patch) | |
tree | 0f86335922b092991e3d7338bcff0efefc9b0368 /string.c | |
parent | 5f13d888cf0aece7c1bb13b72773f66a4b9cebff (diff) | |
download | ruby-7eb5352e24393201fa259bf85de2d84507039d68.tar.gz |
* string.c (rb_str_resize):: fix r28857 that failed to revert r28851.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1723,7 +1723,7 @@ rb_str_resize(VALUE str, long len) else if (len <= RSTRING_EMBED_LEN_MAX) { char *ptr = RSTRING(str)->as.heap.ptr; STR_SET_EMBED(str); - if (slen > 0) MEMCPY(RSTRING(str)->as.ary, ptr, char, slen); + if (slen > 0) MEMCPY(RSTRING(str)->as.ary, ptr, char, len); RSTRING(str)->as.ary[len] = '\0'; STR_SET_EMBED_LEN(str, len); if (independent) xfree(ptr); |