diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-04-30 04:11:33 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-04-30 04:11:33 +0000 |
commit | bf1e26cc332ddf66128dac2afb4cf04b01e0646e (patch) | |
tree | fc148a382afbb0502c34e2be36068108b542cab3 /ext/stringio | |
parent | e3fa6fdceea36aac2ad985d77c50b28333beb3b3 (diff) |
* ext/stringio/stringio.c (strio_getline): suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/stringio')
-rw-r--r-- | ext/stringio/stringio.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 3ec73a62ca..776e5231b7 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -872,8 +872,7 @@ strio_getline(argc, argv, ptr) } } s = p; - while (p = memchr(p, '\n', e - p)) { - if (p == e) break; + while ((p = memchr(p, '\n', e - p)) && (p != e)) { if (*++p == '\n') { e = p; break; @@ -882,7 +881,7 @@ strio_getline(argc, argv, ptr) str = rb_str_substr(ptr->string, s - RSTRING(ptr->string)->ptr, e - s); } else if (n == 1) { - if (p = memchr(s, RSTRING(str)->ptr[0], e - s)) { + if ((p = memchr(s, RSTRING(str)->ptr[0], e - s)) != 0) { e = p + 1; } str = rb_str_substr(ptr->string, ptr->pos, e - s); |