diff options
Diffstat (limited to 'src/Common/zlib/gzread.c')
-rw-r--r-- | src/Common/zlib/gzread.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/Common/zlib/gzread.c b/src/Common/zlib/gzread.c index 956b91ea..884c9bfe 100644 --- a/src/Common/zlib/gzread.c +++ b/src/Common/zlib/gzread.c @@ -1,6 +1,6 @@ /* 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 */ #include "gzguts.h" @@ -313,11 +313,11 @@ local z_size_t gz_read(state, buf, len) /* get len bytes to buf, or less than len if at the end */ 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) { if (state->x.have < n) @@ -396,9 +396,9 @@ int ZEXPORT gzread(file, buf, len) return -1; } /* 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) return -1; @@ -446,9 +446,8 @@ z_size_t ZEXPORT gzfread(buf, size, nitems, file) #endif int ZEXPORT gzgetc(file) gzFile file; { - int ret; unsigned char buf[1]; gz_statep state; /* get internal structure */ @@ -468,10 +467,9 @@ int ZEXPORT gzgetc(file) return *(state->x.next)++; } /* 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) gzFile file; |