From 6299619da97a74a4f0e303d069ab5fd1d781a79e Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 7 Oct 2004 04:06:41 +0000 Subject: * 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/trunk@7010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'io.c') 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) { -- cgit v1.2.3