summaryrefslogtreecommitdiff
path: root/gzlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'gzlib.c')
-rw-r--r--gzlib.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gzlib.c b/gzlib.c
index 15999ae..d1b6253 100644
--- a/gzlib.c
+++ b/gzlib.c
@@ -5,7 +5,7 @@
#include "gzguts.h"
-#if _LARGEFILE64_SOURCE == 1 && _LFS64_LARGEFILE == 1
+#if _LARGEFILE64_SOURCE && _LFS64_LARGEFILE
# define LSEEK lseek64
#else
# define LSEEK lseek
@@ -172,6 +172,7 @@ local gzFile gz_open(path, fd, mode)
O_APPEND))),
0666);
if (state->fd == -1) {
+ free(state->path);
free(state);
return NULL;
}
@@ -432,7 +433,8 @@ int ZEXPORT gzeof(file)
return 0;
/* return end-of-file state */
- return state->mode == GZ_READ ? (state->eof && state->have == 0) : 0;
+ return state->mode == GZ_READ ?
+ (state->eof && state->strm.avail_in == 0 && state->have == 0) : 0;
}
/* -- see zlib.h -- */