summaryrefslogtreecommitdiff
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
commit6299619da97a74a4f0e303d069ab5fd1d781a79e (patch)
treee0a320235de1de0a41c1a6cec96ec3cfa52fbc4b
parent2ed1cdbb0da44d346fc57a4f583392a8636bfd6b (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/trunk@7010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--io.c2
-rw-r--r--pack.c2
3 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8f5ced6f9b..bdf98804d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Thu Oct 7 12:55:04 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * 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]
+
Thu Oct 7 02:56:43 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/stringio/stringio.c: use FMODE_APPEND.
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) {
diff --git a/pack.c b/pack.c
index fa4f8e3b6a..fdca0ed028 100644
--- a/pack.c
+++ b/pack.c
@@ -1311,9 +1311,9 @@ pack_unpack(str, fmt)
#endif
StringValue(str);
+ StringValue(fmt);
s = RSTRING(str)->ptr;
send = s + RSTRING(str)->len;
- StringValue(fmt);
p = RSTRING(fmt)->ptr;
pend = p + RSTRING(fmt)->len;