VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/zlib/gzlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/zlib/gzlib.c')
-rw-r--r--src/Common/zlib/gzlib.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Common/zlib/gzlib.c b/src/Common/zlib/gzlib.c
index 29fc4486..983153cc 100644
--- a/src/Common/zlib/gzlib.c
+++ b/src/Common/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
+}