Fix bug in gzread.c when end-of-file is reached.
authorMark Adler <madler@alumni.caltech.edu>
Mon, 12 Dec 2011 07:30:56 +0000 (23:30 -0800)
committerMark Adler <madler@alumni.caltech.edu>
Mon, 12 Dec 2011 07:30:56 +0000 (23:30 -0800)
gzread.c

index cda7935..1e97e38 100644 (file)
--- a/gzread.c
+++ b/gzread.c
@@ -242,7 +242,7 @@ local int gz_fetch(state)
             if (gz_decomp(state) == -1)
                 return -1;
         }
-    } while (state->x.have == 0);
+    } while (state->x.have == 0 && (!state->eof || strm->avail_in));
     return 0;
 }