summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-02-05 10:27:34 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-02-05 10:27:34 +0000
commit9b64dfe3b8f0343ebf97ae80d3a4ec3f4bd115b3 (patch)
tree7acd7b77321fdbc63149b47fde3bace6f7733614 /string.c
parent06d4e3b42d836b762c29cdc9dc7181caf14dcdec (diff)
990205
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@391 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 3e6dc53..7ded9e3 100644
--- a/string.c
+++ b/string.c
@@ -1140,7 +1140,7 @@ rb_str_gsub_bang(argc, argv, str)
}
if (RSTRING(str)->len > offset) {
len = bp - buf;
- if (blen - len < RSTRING(str)->len - offset) {
+ if (blen - len < RSTRING(str)->len - offset + 1) {
REALLOC_N(buf, char, len + RSTRING(str)->len - offset + 1);
bp = buf + len;
}