summaryrefslogtreecommitdiff
path: root/uncompr.c
diff options
context:
space:
mode:
authorMika Lindqvist <postmaster@raasu.org>2018-03-22 11:01:18 +0200
committerHans Kristian Rosbach <hk-github@circlestorm.org>2018-03-22 10:01:18 +0100
commitec6adfbfb0e482707b194de916f9325e64d2137d (patch)
tree9b4bc4a4933b851232327e5d9b40683d43a70840 /uncompr.c
parent6f2fdf7b755f06bfe3d81c33fcfb9d5f12bad0da (diff)
[MSVC] Fix size_t/ssize_t when using ZLIB_COMPAT. (#161)
* zconf.h.in wasn't including Windows.h, that is correct header to include definitions from BaseTsd.h, and such missing required type definition for ssize_t when compiling using MS Visual C++ * Various places need implicit casting to z_size_t to get around compatibility issues, this will truncate the result when ZLIB_COMPAT is defined, calling code should check for truncation. * Add ZLIB_COMPAT flag to nmake Makefile and use it to determine correct filenames instead of WITH_GZFILEOP
Diffstat (limited to 'uncompr.c')
-rw-r--r--uncompr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/uncompr.c b/uncompr.c
index 68a29cf..77b931c 100644
--- a/uncompr.c
+++ b/uncompr.c
@@ -73,7 +73,7 @@ int ZEXPORT PREFIX(uncompress2)(unsigned char *dest, z_size_t *destLen, const un
*sourceLen -= len + stream.avail_in;
if (dest != buf)
- *destLen = stream.total_out;
+ *destLen = (z_size_t)stream.total_out;
else if (stream.total_out && err == Z_BUF_ERROR)
left = 1;