summaryrefslogtreecommitdiffstats
path: root/pack.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-18 11:51:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-18 11:51:10 +0000
commitb93e4a433a5af1ce225775a0e1fb1b90597bc242 (patch)
treefab76c72ef451e83e55167fecc1f0b8d0fcbd86e /pack.c
parente9166baef6e4fe75d48b5025d43b7a5669c3b263 (diff)
downloadruby-b93e4a433a5af1ce225775a0e1fb1b90597bc242.tar.gz
ruby-b93e4a433a5af1ce225775a0e1fb1b90597bc242.tar.xz
ruby-b93e4a433a5af1ce225775a0e1fb1b90597bc242.zip
* pack.c (pack_pack): avoid infinite loop at comment.
* pack.c (pack_unpack): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r--pack.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/pack.c b/pack.c
index 00237659d..77ad3653b 100644
--- a/pack.c
+++ b/pack.c
@@ -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;