summaryrefslogtreecommitdiff
path: root/uncompr.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2016-12-31 08:49:17 -0800
committerHans Kristian Rosbach <hk-git@circlestorm.org>2017-02-07 10:38:47 +0100
commitcd0071573cb2189ab059c91d1249e5ec4a4df991 (patch)
treea1586227f5b373ba44a3a48ca4d87c6fb9d88601 /uncompr.c
parenta7edd5a1a6be7cf6ee5f789df09020d323a91ab9 (diff)
Use a uniform approach for the largest value of an unsigned type.
Diffstat (limited to 'uncompr.c')
-rw-r--r--uncompr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/uncompr.c b/uncompr.c
index 834ffc9..7bf47b8 100644
--- a/uncompr.c
+++ b/uncompr.c
@@ -27,7 +27,7 @@
int ZEXPORT uncompress2(unsigned char *dest, size_t *destLen, const unsigned char *source, size_t *sourceLen) {
z_stream stream;
int err;
- const unsigned int max = (unsigned int)0 - 1;
+ const unsigned int max = (unsigned int)-1;
size_t len, left;
unsigned char buf[1]; /* for detection of incomplete stream when *destLen == 0 */