diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-04-11 12:15:46 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-04-11 12:15:46 (GMT) |
commit | 20893de885456ce9dd6a8e736057a278725bb47a (patch) | |
tree | ef52308917db211451f0dfd15128fcd76ecc0216 /compat/zlib/gzread.c | |
parent | 616b93b0239bfc54be3cc05955f22e6a07ed0127 (diff) | |
download | tcl-20893de885456ce9dd6a8e736057a278725bb47a.zip tcl-20893de885456ce9dd6a8e736057a278725bb47a.tar.gz tcl-20893de885456ce9dd6a8e736057a278725bb47a.tar.bz2 |
Update zlib to version 1.2.12 (windows-arm version of zlib1.dll still missing)
Diffstat (limited to 'compat/zlib/gzread.c')
-rw-r--r-- | compat/zlib/gzread.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/compat/zlib/gzread.c b/compat/zlib/gzread.c index 956b91e..884c9bf 100644 --- a/compat/zlib/gzread.c +++ b/compat/zlib/gzread.c @@ -1,5 +1,5 @@ /* gzread.c -- zlib functions for reading gzip files - * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler + * Copyright (C) 2004-2017 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -314,9 +314,9 @@ local z_size_t gz_read(state, buf, len) got = 0; do { /* set n to the maximum amount of len that fits in an unsigned int */ - n = -1; + n = (unsigned)-1; if (n > len) - n = len; + n = (unsigned)len; /* first just try copying data from the output buffer */ if (state->x.have) { @@ -397,7 +397,7 @@ int ZEXPORT gzread(file, buf, len) } /* read len or fewer bytes to buf */ - len = gz_read(state, buf, len); + len = (unsigned)gz_read(state, buf, len); /* check for an error */ if (len == 0 && state->err != Z_OK && state->err != Z_BUF_ERROR) @@ -447,7 +447,6 @@ z_size_t ZEXPORT gzfread(buf, size, nitems, file) int ZEXPORT gzgetc(file) gzFile file; { - int ret; unsigned char buf[1]; gz_statep state; @@ -469,8 +468,7 @@ int ZEXPORT gzgetc(file) } /* nothing there -- try gz_read() */ - ret = gz_read(state, buf, 1); - return ret < 1 ? -1 : buf[0]; + return gz_read(state, buf, 1) < 1 ? -1 : buf[0]; } int ZEXPORT gzgetc_(file) |