Skip to content

Commit ef24c4c

Browse files
committed
Reject invalid MAX_WBITS values at compile time.
1 parent 6d3a66a commit ef24c4c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

zutil.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
6565
/* To be used only when the state is known to be valid */
6666

6767
/* common constants */
68-
68+
#if MAX_WBITS < 9 || MAX_WBITS > 15
69+
# error MAX_WBITS must be in 9..15
70+
#endif
6971
#ifndef DEF_WBITS
7072
# define DEF_WBITS MAX_WBITS
7173
#endif

0 commit comments

Comments
 (0)