From a70f475dbbdd0e8f2b14d98aefc3d01fc5af3d17 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 29 Nov 2004 07:06:21 +0000 Subject: * ext/stringio/stringio.c (strio_write): insufficiently filled string being extended when overwriting. [ruby-core:03836] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/stringio/stringio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/stringio/stringio.c') diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 09ecc6926e..8750262c11 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -794,7 +794,7 @@ strio_write(self, str) else { if (ptr->pos + len > olen) { rb_str_resize(ptr->string, ptr->pos + len); - MEMZERO(RSTRING(ptr->string)->ptr + olen, char, ptr->pos - olen); + MEMZERO(RSTRING(ptr->string)->ptr + olen, char, ptr->pos + len - olen); } else { rb_str_modify(ptr->string); -- cgit v1.2.3