]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fixed signed integer comparison warning in deflatePrime bits check.
authorNathan Moinvaziri <nathan@nathanm.com>
Sat, 4 Jul 2020 03:10:25 +0000 (20:10 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Fri, 10 Jul 2020 13:41:41 +0000 (15:41 +0200)
    deflate.c:589:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

deflate.c

index 8af1af32a18f815af89036bf15f9706f59b7e5f6..815c5219159256b5e8c297b6f498cceb5d082d93 100644 (file)
--- a/deflate.c
+++ b/deflate.c
@@ -587,7 +587,7 @@ int32_t ZEXPORT PREFIX(deflatePrime)(PREFIX3(stream) *strm, int32_t bits, int32_
     if (deflateStateCheck(strm))
         return Z_STREAM_ERROR;
     s = strm->state;
-    if (bits < 0 || bits > BIT_BUF_SIZE || bits > (sizeof(value) << 3) ||
+    if (bits < 0 || bits > BIT_BUF_SIZE || bits > (int32_t)(sizeof(value) << 3) ||
         s->sym_buf < s->pending_out + ((BIT_BUF_SIZE + 7) >> 3))
         return Z_BUF_ERROR;
     do {