summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-04 17:31:09 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-04 17:31:09 +0000
commit7eb5352e24393201fa259bf85de2d84507039d68 (patch)
tree0f86335922b092991e3d7338bcff0efefc9b0368 /string.c
parent5f13d888cf0aece7c1bb13b72773f66a4b9cebff (diff)
downloadruby-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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index 9fe344a20f..d27c67a948 100644
--- a/string.c
+++ b/string.c
@@ -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);