summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-15 12:35:52 +0000
committerngoto <ngoto@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-15 12:35:52 +0000
commit2bb292fccf9560b2c885b4368e5c5fc3fe2a2bda (patch)
treee4ead55e232d779f7234e400e2c89dbf835d81c5 /string.c
parent83a5457fa7ff6731adfa438f3f239896e7cff9ad (diff)
* string.c (str_buf_cat): Fix capa size for embed string.
Fix bug in r55547. [Bug #12536] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55691 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 4bc4ebfd99..514488fd93 100644
--- a/string.c
+++ b/string.c
@@ -2570,7 +2570,7 @@ str_buf_cat(VALUE str, const char *ptr, long len)
rb_str_modify(str);
if (len == 0) return 0;
if (STR_EMBED_P(str)) {
- capa = RSTRING_EMBED_LEN_MAX + termlen - 1;
+ capa = RSTRING_EMBED_LEN_MAX + 1 - termlen;
sptr = RSTRING(str)->as.ary;
olen = RSTRING_EMBED_LEN(str);
}