From: Mika Lindqvist Date: Tue, 12 May 2015 23:21:25 +0000 (+0300) Subject: Fix integer overflow warning X-Git-Tag: 1.9.9-b1~830 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c1a5f33bcb68d8a5b50165dabb63b1e669b3e89;p=thirdparty%2Fzlib-ng.git Fix integer overflow warning * Move declaration of "plevel" below declaration of "level" --- diff --git a/test/minigzip.c b/test/minigzip.c index 4e589c2f7..80f4c12c9 100644 --- a/test/minigzip.c +++ b/test/minigzip.c @@ -101,6 +101,7 @@ gzFile gz_open(const char *path, int fd, const char *mode) gzFile gz; int ret; int level = Z_DEFAULT_COMPRESSION; + const char *plevel = mode; gz = malloc(sizeof(struct gzFile_s)); if (gz == NULL) @@ -110,7 +111,6 @@ gzFile gz_open(const char *path, int fd, const char *mode) gz->strm.zfree = myfree; gz->strm.opaque = Z_NULL; - const char *plevel = mode; while (*plevel) { if (*plevel >= '0' && *plevel <= '9') { level = *plevel - '0'; @@ -167,7 +167,7 @@ int gzread (gzFile, void *, unsigned); int gzread(gzFile gz, void *buf, unsigned len) { int ret; - unsigned got; + size_t got; unsigned char in[1]; z_stream *strm;