Skip to content

Commit

Permalink
* pack.c (pack_unpack): string conversion should at the top of the
Browse files Browse the repository at this point in the history
  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
  • Loading branch information
matz committed Oct 7, 2004
1 parent 2ed1cdb commit 6299619
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Thu Oct 7 12:55:04 2004 Yukihiro Matsumoto <[email protected]>

* 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 <[email protected]>

* ext/stringio/stringio.c: use FMODE_APPEND.
Expand Down
2 changes: 1 addition & 1 deletion io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 6299619

Please sign in to comment.