From ff8670e601de76a7887f856802b6d16faaa3f62d Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Thu, 24 Jul 2003 00:03:51 +0000 Subject: [PATCH] MFH: zlib fix --- ext/zlib/zlib_fopen_wrapper.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c index 0746a03161..6e296efc73 100644 --- a/ext/zlib/zlib_fopen_wrapper.c +++ b/ext/zlib/zlib_fopen_wrapper.c @@ -52,14 +52,12 @@ static size_t php_gziop_write(php_stream *stream, const char *buf, size_t count static int php_gziop_seek(php_stream *stream, off_t offset, int whence, off_t *newoffs TSRMLS_DC) { struct php_gz_stream_data_t *self = (struct php_gz_stream_data_t *)stream->abstract; - int ret; - + assert(self != NULL); - - ret = gzseek(self->gz_file, offset, whence); - *newoffs = gztell(self->gz_file); - - return ret < 0 ? -1 : 0; + + *newoffs = gzseek(self->gz_file, offset, whence); + + return *newoffs < 0 ? -1 : 0; } static int php_gziop_close(php_stream *stream, int close_handle TSRMLS_DC) -- 2.50.1