Skip to content

Commit

Permalink
Remove unneeded dependency on limits.h in examples/zran.c.
Browse files Browse the repository at this point in the history
  • Loading branch information
madler committed Sep 1, 2024
1 parent fff132f commit 2968a49
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/zran.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* zran.c -- example of deflate stream indexing and random access
* Copyright (C) 2005, 2012, 2018, 2023, 2024 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
* Version 1.5 4 Feb 2024 Mark Adler */
* Version 1.6 2 Aug 2024 Mark Adler */

/* Version History:
1.0 29 May 2005 First version
Expand All @@ -18,6 +18,7 @@
Stop decoding once request is satisfied
Provide a reusable inflate engine in the index
Allocate the dictionaries to reduce memory usage
1.6 2 Aug 2024 Remove unneeded dependency on limits.h
*/

// Illustrate the use of Z_BLOCK, inflatePrime(), and inflateSetDictionary()
Expand Down Expand Up @@ -61,7 +62,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include "zlib.h"
#include "zran.h"

Expand Down Expand Up @@ -390,8 +390,8 @@ ptrdiff_t deflate_index_extract(FILE *in, struct deflate_index *index,
}
else {
// Uncompress up to left bytes into buf.
index->strm.avail_out = left < UINT_MAX ? (unsigned)left :
UINT_MAX;
index->strm.avail_out = left < (unsigned)-1 ? (unsigned)left :
(unsigned)-1;
index->strm.next_out = buf + len - left;
}

Expand Down

0 comments on commit 2968a49

Please sign in to comment.