diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-02-18 11:51:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-02-18 11:51:10 +0000 |
commit | 7ef48b40badefe862f3b96ec7d2f687406876d81 (patch) | |
tree | fab76c72ef451e83e55167fecc1f0b8d0fcbd86e /pack.c | |
parent | 7de72c4858a8240ae025aecb3599291f0bf90e34 (diff) |
* pack.c (pack_pack): avoid infinite loop at comment.
* pack.c (pack_unpack): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r-- | pack.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -364,8 +364,7 @@ pack_pack(ary, fmt) if (ISSPACE(type)) continue; if (type == '#') { - while (p < pend) { - if (*p == '\n') continue; + while ((p < pend) && (*p != '\n')) { p++; } break; @@ -1084,8 +1083,7 @@ pack_unpack(str, fmt) if (ISSPACE(type)) continue; if (type == '#') { - while (p < pend) { - if (*p == '\n') continue; + while ((p < pend) && (*p != '\n')) { p++; } break; |