From 9c3a5830218c4e7fff23b8fc4386269db77a03a9 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Fri, 9 Sep 2011 23:24:52 -0700 Subject: zlib 1.2.2.4 --- gzio.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gzio.c') diff --git a/gzio.c b/gzio.c index b069b7a..7e90f49 100644 --- a/gzio.c +++ b/gzio.c @@ -489,6 +489,9 @@ int ZEXPORT gzread (file, buf, len) } s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); + if (len == s->stream.avail_out && + (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO)) + return -1; return (int)(len - s->stream.avail_out); } @@ -975,9 +978,9 @@ int ZEXPORT gzclose (file) #endif /* =========================================================================== - Returns the error message for the last error which occured on the + Returns the error message for the last error which occurred on the given compressed file. errnum is set to zlib error number. If an - error occured in the file system and not in the compression library, + error occurred in the file system and not in the compression library, errnum is set to Z_ERRNO and the application may consult errno to get the exact error code. */ -- cgit v1.2.3-55-g6feb