Skip to content

Commit af1c28b

Browse files
madlerkornelski
authored andcommitted
Reject invalid MAX_WBITS values at compile time.
1 parent 5ad6990 commit af1c28b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

zutil.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
5353
/* To be used only when the state is known to be valid */
5454

5555
/* common constants */
56-
56+
#if MAX_WBITS < 9 || MAX_WBITS > 15
57+
# error MAX_WBITS must be in 9..15
58+
#endif
5759
#ifndef DEF_WBITS
5860
# define DEF_WBITS MAX_WBITS
5961
#endif

0 commit comments

Comments
 (0)