summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/stringio/stringio.c2
-rw-r--r--ext/zlib/zlib.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index 8d3275b2b8..46217c7bc8 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -908,7 +908,7 @@ strio_sysread(argc, argv, self)
VALUE self;
{
VALUE val = strio_read(argc, argv, self);
- if (NIL_P(val)) {
+ if (NIL_P(val) || RSTRING(val)->len == 0) {
rb_eof_error();
}
return val;
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 80b45ad0c9..e22d988406 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -2486,7 +2486,7 @@ gzreader_gets(argc, argv, obj)
if (NIL_P(rs)) {
dst = gzfile_read_all(gz);
- if (!NIL_P(dst)) gz->lineno++;
+ if (RSTRING(dst)->len != 0) gz->lineno++;
return dst;
}