diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-02-17 09:40:29 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-02-17 12:20:28 +0100 |
| commit | b90437119d2ebe3211dcaf9bfee7e68eb5058874 (patch) | |
| tree | 9f6e2497af3ee07e6a8083dc4ef42dde5b6a951d /zlib/gzlib.c | |
| parent | 00cdb1757ff37177d7a6440fc94f044b5614c821 (diff) | |
Update bundled zlib to version 1.3.1
Diffstat (limited to 'zlib/gzlib.c')
| -rw-r--r-- | zlib/gzlib.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/zlib/gzlib.c b/zlib/gzlib.c index 29fc4486f..983153cc8 100644 --- a/zlib/gzlib.c +++ b/zlib/gzlib.c @@ -1,5 +1,5 @@ /* gzlib.c -- zlib functions common to reading and writing gzip files - * Copyright (C) 2004-2019 Mark Adler + * Copyright (C) 2004-2024 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -563,20 +563,20 @@ void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) { #endif } -#ifndef INT_MAX /* portably return maximum value for an int (when limits.h presumed not available) -- we need to do this to cover cases where 2's complement not used, since C standard permits 1's complement and sign-bit representations, otherwise we could just use ((unsigned)-1) >> 1 */ unsigned ZLIB_INTERNAL gz_intmax(void) { - unsigned p, q; - - p = 1; +#ifdef INT_MAX + return INT_MAX; +#else + unsigned p = 1, q; do { q = p; p <<= 1; p++; } while (p > q); return q >> 1; -} #endif +} |
