aboutsummaryrefslogtreecommitdiff
path: root/archival/libunarchive
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-03-20 13:30:40 +0000
committerEric Andersen <andersen@codepoet.org>2002-03-20 13:30:40 +0000
commit89de1e7930a752e0a444d30172ca508f58f02365 (patch)
tree5ffc4f037391cd1fcc57d4dfffe7b48822fd8496 /archival/libunarchive
parentb5474c48b158f4a7d60f4b4faa40129c7eda6e9f (diff)
downloadbusybox-89de1e7930a752e0a444d30172ca508f58f02365.tar.gz
Reinitialize initial shift register value for on each pass.
-Erik
Diffstat (limited to 'archival/libunarchive')
-rw-r--r--archival/libunarchive/decompress_unzip.c4
-rw-r--r--archival/libunarchive/unzip.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/archival/libunarchive/decompress_unzip.c b/archival/libunarchive/decompress_unzip.c
index 8075fd717..9f6ed2ebe 100644
--- a/archival/libunarchive/decompress_unzip.c
+++ b/archival/libunarchive/decompress_unzip.c
@@ -73,7 +73,7 @@ static FILE *in_file, *out_file;
static unsigned char *window;
static unsigned long *crc_table;
-static unsigned long crc = 0xffffffffL; /* shift register contents */
+static unsigned long crc; /* shift register contents */
/* Return codes from gzip */
static const int ERROR = 1;
@@ -126,6 +126,8 @@ static void make_crc_table(void)
const unsigned long poly = 0xedb88320; /* polynomial exclusive-or pattern */
unsigned short i; /* counter for all possible eight bit values */
+ /* initial shift register value */
+ crc = 0xffffffffL;
crc_table = (unsigned long *) malloc(256 * sizeof(unsigned long));
/* Compute and print table of CRC's, five per line */
diff --git a/archival/libunarchive/unzip.c b/archival/libunarchive/unzip.c
index 8075fd717..9f6ed2ebe 100644
--- a/archival/libunarchive/unzip.c
+++ b/archival/libunarchive/unzip.c
@@ -73,7 +73,7 @@ static FILE *in_file, *out_file;
static unsigned char *window;
static unsigned long *crc_table;
-static unsigned long crc = 0xffffffffL; /* shift register contents */
+static unsigned long crc; /* shift register contents */
/* Return codes from gzip */
static const int ERROR = 1;
@@ -126,6 +126,8 @@ static void make_crc_table(void)
const unsigned long poly = 0xedb88320; /* polynomial exclusive-or pattern */
unsigned short i; /* counter for all possible eight bit values */
+ /* initial shift register value */
+ crc = 0xffffffffL;
crc_table = (unsigned long *) malloc(256 * sizeof(unsigned long));
/* Compute and print table of CRC's, five per line */