diff options
Diffstat (limited to 'gzio.c')
-rw-r--r-- | gzio.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -489,6 +489,9 @@ int ZEXPORT gzread (file, buf, len) | |||
489 | } | 489 | } |
490 | s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); | 490 | s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); |
491 | 491 | ||
492 | if (len == s->stream.avail_out && | ||
493 | (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO)) | ||
494 | return -1; | ||
492 | return (int)(len - s->stream.avail_out); | 495 | return (int)(len - s->stream.avail_out); |
493 | } | 496 | } |
494 | 497 | ||
@@ -975,9 +978,9 @@ int ZEXPORT gzclose (file) | |||
975 | #endif | 978 | #endif |
976 | 979 | ||
977 | /* =========================================================================== | 980 | /* =========================================================================== |
978 | Returns the error message for the last error which occured on the | 981 | Returns the error message for the last error which occurred on the |
979 | given compressed file. errnum is set to zlib error number. If an | 982 | given compressed file. errnum is set to zlib error number. If an |
980 | error occured in the file system and not in the compression library, | 983 | error occurred in the file system and not in the compression library, |
981 | errnum is set to Z_ERRNO and the application may consult errno | 984 | errnum is set to Z_ERRNO and the application may consult errno |
982 | to get the exact error code. | 985 | to get the exact error code. |
983 | */ | 986 | */ |