diff options
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1556,7 +1556,8 @@ read_all(rb_io_t *fptr, long siz, VALUE str) int cr; if (NEED_READCONV(fptr)) { - if (!NIL_P(str)) rb_str_set_len(str, 0); + if (NIL_P(str)) str = rb_str_new(NULL, 0); + else rb_str_set_len(str, 0); make_readconv(fptr); while (1) { if (fptr->cbuf_len) { |