VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/zlib/gzlib.c
diff options
context:
space:
mode:
authorDLL125 <134442578+DLL125@users.noreply.github.com>2024-04-10 18:47:29 +0200
committerGitHub <noreply@github.com>2024-04-10 18:47:29 +0200
commitecf1047019190d07468489d2dfd2fdc56c092e26 (patch)
tree539c0290be9f1d8ddc4dc2a8ce51be6d7707383c /src/Common/zlib/gzlib.c
parentce2a254c51cdd14f9087142391185156e3cc6eac (diff)
downloadVeraCrypt-ecf1047019190d07468489d2dfd2fdc56c092e26.tar.gz
VeraCrypt-ecf1047019190d07468489d2dfd2fdc56c092e26.zip
update zlib + copyright (#1302)
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
+}