aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index de80872ca4..f188f74c11 100644
--- a/io.c
+++ b/io.c
@@ -1195,10 +1195,10 @@ io_read(argc, argv, io)
rb_str_modify(str);
rb_str_resize(str,len);
}
- FL_SET(str, FL_FREEZE);
if (len == 0) return str;
READ_CHECK(fptr->f);
+ FL_SET(str, FL_FREEZE);
n = rb_io_fread(RSTRING(str)->ptr, len, fptr->f);
FL_UNSET(str, FL_FREEZE);
if (n == 0) {