]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Do not initialize unsigned with -1 in compress.c uncompr.c.
authorMark Adler <madler@alumni.caltech.edu>
Sun, 2 Aug 2015 23:47:14 +0000 (16:47 -0700)
committerHans Kristian Rosbach <hk-git@circlestorm.org>
Tue, 3 Nov 2015 17:52:30 +0000 (18:52 +0100)
Sun compiler complained.  Use (unsigned)0 - 1 instead.

compress.c
uncompr.c

index abae9b3ae229235720ead667a309690584575cc2..2e4c8d7fd56a5042d80fd53230adf4a14b86c875 100644 (file)
@@ -23,7 +23,7 @@ int ZEXPORT compress2(unsigned char *dest, uLong *destLen, const unsigned char *
                         uLong sourceLen, int level) {
     z_stream stream;
     int err;
-    const uInt max = -1;
+    const uInt max = (uInt)0 - 1;
     uLong left;
 
     left = *destLen;
index ab61f742413fc603c94f756970d0bca8515a520e..d94d3d624bbc30013dedb8cb7eb8e97c7187aac2 100644 (file)
--- a/uncompr.c
+++ b/uncompr.c
@@ -25,7 +25,7 @@
 int ZEXPORT uncompress(unsigned char *dest, uLong *destLen, const unsigned char *source, uLong sourceLen) {
     z_stream stream;
     int err;
-    const uInt max = -1;
+    const uInt max = (uInt)0 - 1;
     uLong left;
     Byte buf[1];    /* for detection of incomplete stream when *destLen == 0 */