From bdb53ef1b17916cd039cc830280a1b453a7090d8 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 1 Jul 2010 11:46:56 -0700 Subject: [PATCH] Don't assume that sizeof (long) == 4 when computing statistics. * gzip.c (get_method): Don't assume sizeof (long) == 4. * zip.c (zip): Likewise. --- gzip.c | 2 +- zip.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gzip.c b/gzip.c index 4762e88..411ca42 100644 --- a/gzip.c +++ b/gzip.c @@ -1391,7 +1391,7 @@ local int get_method(in) while (get_char() != 0) /* null */ ; } if (part_nb == 1) { - header_bytes = inptr + 2*sizeof(long); /* include crc and size */ + header_bytes = inptr + 2*4; /* include crc and size */ } } else if (memcmp(magic, PKZIP_MAGIC, 2) == 0 && inptr == 2 diff --git a/zip.c b/zip.c index a30a561..dc4a21c 100644 --- a/zip.c +++ b/zip.c @@ -96,7 +96,7 @@ int zip(in, out) /* Write the crc and uncompressed size */ put_long(crc); put_long((ulg)bytes_in); - header_bytes += 2*sizeof(long); + header_bytes += 2*4; flush_outbuf(); return OK; -- 2.47.2