summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive_read_support_format_zip.c
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2007-04-15 00:53:38 +0000
committerkientzle <kientzle@FreeBSD.org>2007-04-15 00:53:38 +0000
commitcc44f89006ca6ae738f04f8efb58efbbd52a7268 (patch)
tree77e2b47f8d4f88350fd88646e5a721011efe04d4 /lib/libarchive/archive_read_support_format_zip.c
parent034ed0ce440f90570c5fb879ba9edb6725caaf1c (diff)
downloadFreeBSD-src-cc44f89006ca6ae738f04f8efb58efbbd52a7268.zip
FreeBSD-src-cc44f89006ca6ae738f04f8efb58efbbd52a7268.tar.gz
Consolidate numeric limit macros in one place; include them
only on platforms that need them. FreeBSD doesn't.
Diffstat (limited to 'lib/libarchive/archive_read_support_format_zip.c')
-rw-r--r--lib/libarchive/archive_read_support_format_zip.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/libarchive/archive_read_support_format_zip.c b/lib/libarchive/archive_read_support_format_zip.c
index f15eba0..857d3f7 100644
--- a/lib/libarchive/archive_read_support_format_zip.c
+++ b/lib/libarchive/archive_read_support_format_zip.c
@@ -137,9 +137,6 @@ static int zip_read_file_header(struct archive_read *a,
static time_t zip_time(const char *);
static void process_extra(const void* extra, struct zip* zip);
-/* Largest 32-bit unsigned value, stored in a 64-bit constant. */
-static const uint64_t max_uint32 = (((uint64_t)1) << 32) - 1;
-
int
archive_read_support_format_zip(struct archive *_a)
{
@@ -412,8 +409,8 @@ archive_read_format_zip_read_data(struct archive_read *a,
return (ARCHIVE_WARN);
}
/* Size field only stores the lower 32 bits of the actual size. */
- if ((zip->uncompressed_size & max_uint32)
- != (zip->entry_uncompressed_bytes_read & max_uint32)) {
+ if ((zip->uncompressed_size & UINT32_MAX)
+ != (zip->entry_uncompressed_bytes_read & UINT32_MAX)) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"ZIP uncompressed data is wrong size");
return (ARCHIVE_WARN);
OpenPOWER on IntegriCloud