summaryrefslogtreecommitdiff
path: root/ext/stringio
diff options
context:
space:
mode:
Diffstat (limited to 'ext/stringio')
-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 4d960c4ea3..f46af0f0ad 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);