summaryrefslogtreecommitdiffstats
path: root/ext/stringio
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-04-30 04:11:33 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-04-30 04:11:33 +0000
commit5890266402525a848f2706e51a2fb7cfbbcd9299 (patch)
treebd0820446383e0df6fbefbfbf3a31b957ccc71be /ext/stringio
parent405adf30ee2648505b7c80f6284ae0e93933097a (diff)
downloadruby-5890266402525a848f2706e51a2fb7cfbbcd9299.tar.gz
ruby-5890266402525a848f2706e51a2fb7cfbbcd9299.tar.xz
ruby-5890266402525a848f2706e51a2fb7cfbbcd9299.zip
* ext/stringio/stringio.c (strio_getline): suppress warnings.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/stringio')
-rw-r--r--ext/stringio/stringio.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index 9d16b235d..db93c1ff8 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -863,8 +863,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;
@@ -873,7 +872,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);