summaryrefslogtreecommitdiffstats
path: root/lib/libz/gzio.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libz/gzio.c')
-rw-r--r--lib/libz/gzio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libz/gzio.c b/lib/libz/gzio.c
index 88e3f03..5424de0 100644
--- a/lib/libz/gzio.c
+++ b/lib/libz/gzio.c
@@ -456,6 +456,10 @@ int ZEXPORT gzread (file, buf, len)
s->z_err = Z_ERRNO;
break;
}
+ if (feof(s->file)) { /* avoid error for empty file */
+ s->z_err = Z_STREAM_END;
+ break;
+ }
}
s->stream.next_in = s->inbuf;
}
OpenPOWER on IntegriCloud