summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compress.c2
-rw-r--r--inflate.c2
-rw-r--r--uncompr.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/compress.c b/compress.c
index 1fba057011..d4f99bb31a 100644
--- a/compress.c
+++ b/compress.c
@@ -23,7 +23,7 @@ int ZEXPORT compress2(unsigned char *dest, size_t *destLen, const unsigned char
size_t sourceLen, int level) {
z_stream stream;
int err;
- const unsigned int max = (unsigned int)0 - 1;
+ const unsigned int max = (unsigned int)-1;
size_t left;
left = *destLen;
diff --git a/inflate.c b/inflate.c
index 298479f860..0f7e3e7118 100644
--- a/inflate.c
+++ b/inflate.c
@@ -1496,7 +1496,7 @@ long ZEXPORT inflateMark(z_stream *strm) {
unsigned long ZEXPORT inflateCodesUsed(z_stream *strm) {
struct inflate_state *state;
if (strm == NULL || strm->state == NULL)
- return (unsigned long)0 - 1;
+ return (unsigned long)-1;
state = (struct inflate_state *)strm->state;
return (unsigned long)(state->next - state->codes);
}
diff --git a/uncompr.c b/uncompr.c
index 834ffc90c9..7bf47b8dd4 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 */