summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/io.c b/io.c
index 8671edeac2..80c12bc5b5 100644
--- a/io.c
+++ b/io.c
@@ -792,6 +792,7 @@ appendline(fptr, delim, strp)
else {
*strp = str = rb_str_buf_new(len);
RSTRING(str)->len = len;
+ RSTRING(str)->ptr[len] = '\0';
}
if (c != EOF) {
RSTRING(str)->ptr[last++] = c;