summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-07 04:06:41 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-10-07 04:06:41 +0000
commit46c777ac1468aa406478ce00bf6acdc430218d6d (patch)
treeca172c881a3179e97f34e2fe04720af1e82ddbd1 /io.c
parentb105d856901616726ad285325e1fa74c980dbeeb (diff)
* pack.c (pack_unpack): string conversion should at the top of the
method. [ruby-dev:24439] * io.c (io_read): buffer should be frozen only after the length check. [ruby-dev:24440] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 76578529c5..ffff98f9e4 100644
--- a/io.c
+++ b/io.c
@@ -1067,11 +1067,11 @@ io_read(argc, argv, io)
StringValue(str);
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) {