diff options
author | George Hazan <george.hazan@gmail.com> | 2015-08-16 14:09:56 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-08-16 14:09:56 +0000 |
commit | 0e9b3d2bca89aaf1a365b6dbecff60c1b41aa28d (patch) | |
tree | 5f3347f6cb09ad0b9fd46881013de682f60bc98d /libs/zlib/src/uncompr.c | |
parent | 44107dd903dd04d00ed3003049f098a24624151f (diff) |
minus 3 warnings
git-svn-id: http://svn.miranda-ng.org/main/trunk@14964 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'libs/zlib/src/uncompr.c')
-rw-r--r-- | libs/zlib/src/uncompr.c | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/libs/zlib/src/uncompr.c b/libs/zlib/src/uncompr.c index 242e9493df..938fa5c13a 100644 --- a/libs/zlib/src/uncompr.c +++ b/libs/zlib/src/uncompr.c @@ -21,39 +21,39 @@ enough memory, Z_BUF_ERROR if there was not enough room in the output buffer, or Z_DATA_ERROR if the input data was corrupted. */ -int ZEXPORT uncompress (dest, destLen, source, sourceLen) - Bytef *dest; - uLongf *destLen; - const Bytef *source; - uLong sourceLen; +int ZEXPORT uncompress(dest, destLen, source, sourceLen) +Bytef *dest; +uLongf *destLen; +const Bytef *source; +uLong sourceLen; { - z_stream stream; - int err; - - stream.next_in = (z_const Bytef *)source; - stream.avail_in = (uInt)sourceLen; - /* Check for source > 64K on 16-bit machine: */ - if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; - - stream.next_out = dest; - stream.avail_out = (uInt)*destLen; - if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; - - stream.zalloc = (alloc_func)0; - stream.zfree = (free_func)0; - - err = inflateInit(&stream); - if (err != Z_OK) return err; - - err = inflate(&stream, Z_FINISH); - if (err != Z_STREAM_END) { - inflateEnd(&stream); - if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) - return Z_DATA_ERROR; - return err; - } - *destLen = stream.total_out; - - err = inflateEnd(&stream); - return err; + z_stream stream; + int err; + + stream.next_in = (z_const Bytef *)source; + stream.avail_in = (uInt)sourceLen; + /* Check for source > 64K on 16-bit machine: */ + if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; + + stream.next_out = dest; + stream.avail_out = (uInt)*destLen; + if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; + + stream.zalloc = (alloc_func)0; + stream.zfree = (free_func)0; + + err = inflateInit(&stream); + if (err != Z_OK) return err; + + err = inflate(&stream, Z_FINISH); + if (err != Z_STREAM_END) { + inflateEnd(&stream); + if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) + return Z_DATA_ERROR; + return err; + } + *destLen = stream.total_out; + + err = inflateEnd(&stream); + return err; } |