From 370ef1b41fd35fbfcf2af317ef3d8065a132f27a Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Sun, 25 May 2025 21:46:47 -0700 Subject: Return all available uncompressed data on error in gzread.c. The error is recorded, and will be detected by the application after all of the uncompressed data has been consumed and then one more call is made to read data. The error is available immediately from gzerror() if the application would like to know earlier. --- gzlib.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gzlib.c') diff --git a/gzlib.c b/gzlib.c index 79a7e978..1c5c7be6 100644 --- a/gzlib.c +++ b/gzlib.c @@ -104,6 +104,7 @@ local gzFile gz_open(const void *path, int fd, const char *mode) { return NULL; state->size = 0; /* no buffers allocated yet */ state->want = GZBUFSIZE; /* requested buffer size */ + state->err = Z_OK; /* no error yet */ state->msg = NULL; /* no error message yet */ /* interpret mode */ -- cgit v1.2.3-55-g6feb