diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2003-07-24 00:03:42 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2003-07-24 00:03:42 +0000 |
commit | 402edee1a6502f161f5705978805fda112a3e640 (patch) | |
tree | d9e4af4a202a1fa399606167337065065d5f2833 /ext/zlib | |
parent | 0bd1e86d4cee536b17ab3c256694d0a36510f78a (diff) | |
download | php-git-402edee1a6502f161f5705978805fda112a3e640.tar.gz |
gztell() is not necessary, the return value of gzseek() represents the
new position. With zlib 1.1.4 gztell() alse returns 0 when working
on non-zlib files (test ext/zlib/tests/gzreadgzwriteplain.phpt).
Diffstat (limited to 'ext/zlib')
-rw-r--r-- | ext/zlib/zlib_fopen_wrapper.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c index e899c378f8..32dc3c1cc8 100644 --- a/ext/zlib/zlib_fopen_wrapper.c +++ b/ext/zlib/zlib_fopen_wrapper.c @@ -56,14 +56,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) |