summaryrefslogtreecommitdiffstats
path: root/ext/stringio/stringio.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-29 07:06:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-29 07:06:21 +0000
commitd571f1ee694b4dc77e33db39b9c911add8853703 (patch)
tree0184e51b6430722c8543fa674f6089477b6399d2 /ext/stringio/stringio.c
parent7e4d5acdfcef6ab407a893950504a2fcc3ce5a4e (diff)
downloadruby-d571f1ee694b4dc77e33db39b9c911add8853703.tar.gz
ruby-d571f1ee694b4dc77e33db39b9c911add8853703.tar.xz
ruby-d571f1ee694b4dc77e33db39b9c911add8853703.zip
* ext/stringio/stringio.c (strio_write): insufficiently filled string
being extended when overwriting. [ruby-core:03836] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/stringio/stringio.c')
-rw-r--r--ext/stringio/stringio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index 09ecc6926..8750262c1 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);