Skip to content
Snippets Groups Projects
Commit b7fbee21 authored by Mark Adler's avatar Mark Adler
Browse files

Use a uniform approach for the largest value of an unsigned type.

parent f3fcb92c
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -28,7 +28,7 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
{
z_stream stream;
int err;
const uInt max = (uInt)0 - 1;
const uInt max = (uInt)-1;
uLong left;
 
left = *destLen;
Loading
Loading
Loading
Loading
@@ -1555,7 +1555,7 @@ unsigned long ZEXPORT inflateCodesUsed(strm)
z_streamp strm;
{
struct inflate_state FAR *state;
if (inflateStateCheck(strm)) return (unsigned long)0 - 1;
if (inflateStateCheck(strm)) return (unsigned long)-1;
state = (struct inflate_state FAR *)strm->state;
return (unsigned long)(state->next - state->codes);
}
Loading
Loading
@@ -32,7 +32,7 @@ int ZEXPORT uncompress2 (dest, destLen, source, sourceLen)
{
z_stream stream;
int err;
const uInt max = (uInt)0 - 1;
const uInt max = (uInt)-1;
uLong len, left;
Byte buf[1]; /* for detection of incomplete stream when *destLen == 0 */
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment