diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-03-20 13:30:40 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-03-20 13:30:40 +0000 |
commit | 89de1e7930a752e0a444d30172ca508f58f02365 (patch) | |
tree | 5ffc4f037391cd1fcc57d4dfffe7b48822fd8496 | |
parent | b5474c48b158f4a7d60f4b4faa40129c7eda6e9f (diff) | |
download | busybox-w32-89de1e7930a752e0a444d30172ca508f58f02365.tar.gz busybox-w32-89de1e7930a752e0a444d30172ca508f58f02365.tar.bz2 busybox-w32-89de1e7930a752e0a444d30172ca508f58f02365.zip |
Reinitialize initial shift register value for on each pass.
-Erik
-rw-r--r-- | archival/libunarchive/decompress_unzip.c | 4 | ||||
-rw-r--r-- | archival/libunarchive/unzip.c | 4 | ||||
-rw-r--r-- | libbb/unzip.c | 4 |
3 files changed, 9 insertions, 3 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; | |||
73 | static unsigned char *window; | 73 | static unsigned char *window; |
74 | static unsigned long *crc_table; | 74 | static unsigned long *crc_table; |
75 | 75 | ||
76 | static unsigned long crc = 0xffffffffL; /* shift register contents */ | 76 | static unsigned long crc; /* shift register contents */ |
77 | 77 | ||
78 | /* Return codes from gzip */ | 78 | /* Return codes from gzip */ |
79 | static const int ERROR = 1; | 79 | static const int ERROR = 1; |
@@ -126,6 +126,8 @@ static void make_crc_table(void) | |||
126 | const unsigned long poly = 0xedb88320; /* polynomial exclusive-or pattern */ | 126 | const unsigned long poly = 0xedb88320; /* polynomial exclusive-or pattern */ |
127 | unsigned short i; /* counter for all possible eight bit values */ | 127 | unsigned short i; /* counter for all possible eight bit values */ |
128 | 128 | ||
129 | /* initial shift register value */ | ||
130 | crc = 0xffffffffL; | ||
129 | crc_table = (unsigned long *) malloc(256 * sizeof(unsigned long)); | 131 | crc_table = (unsigned long *) malloc(256 * sizeof(unsigned long)); |
130 | 132 | ||
131 | /* Compute and print table of CRC's, five per line */ | 133 | /* 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; | |||
73 | static unsigned char *window; | 73 | static unsigned char *window; |
74 | static unsigned long *crc_table; | 74 | static unsigned long *crc_table; |
75 | 75 | ||
76 | static unsigned long crc = 0xffffffffL; /* shift register contents */ | 76 | static unsigned long crc; /* shift register contents */ |
77 | 77 | ||
78 | /* Return codes from gzip */ | 78 | /* Return codes from gzip */ |
79 | static const int ERROR = 1; | 79 | static const int ERROR = 1; |
@@ -126,6 +126,8 @@ static void make_crc_table(void) | |||
126 | const unsigned long poly = 0xedb88320; /* polynomial exclusive-or pattern */ | 126 | const unsigned long poly = 0xedb88320; /* polynomial exclusive-or pattern */ |
127 | unsigned short i; /* counter for all possible eight bit values */ | 127 | unsigned short i; /* counter for all possible eight bit values */ |
128 | 128 | ||
129 | /* initial shift register value */ | ||
130 | crc = 0xffffffffL; | ||
129 | crc_table = (unsigned long *) malloc(256 * sizeof(unsigned long)); | 131 | crc_table = (unsigned long *) malloc(256 * sizeof(unsigned long)); |
130 | 132 | ||
131 | /* Compute and print table of CRC's, five per line */ | 133 | /* Compute and print table of CRC's, five per line */ |
diff --git a/libbb/unzip.c b/libbb/unzip.c index 8075fd717..9f6ed2ebe 100644 --- a/libbb/unzip.c +++ b/libbb/unzip.c | |||
@@ -73,7 +73,7 @@ static FILE *in_file, *out_file; | |||
73 | static unsigned char *window; | 73 | static unsigned char *window; |
74 | static unsigned long *crc_table; | 74 | static unsigned long *crc_table; |
75 | 75 | ||
76 | static unsigned long crc = 0xffffffffL; /* shift register contents */ | 76 | static unsigned long crc; /* shift register contents */ |
77 | 77 | ||
78 | /* Return codes from gzip */ | 78 | /* Return codes from gzip */ |
79 | static const int ERROR = 1; | 79 | static const int ERROR = 1; |
@@ -126,6 +126,8 @@ static void make_crc_table(void) | |||
126 | const unsigned long poly = 0xedb88320; /* polynomial exclusive-or pattern */ | 126 | const unsigned long poly = 0xedb88320; /* polynomial exclusive-or pattern */ |
127 | unsigned short i; /* counter for all possible eight bit values */ | 127 | unsigned short i; /* counter for all possible eight bit values */ |
128 | 128 | ||
129 | /* initial shift register value */ | ||
130 | crc = 0xffffffffL; | ||
129 | crc_table = (unsigned long *) malloc(256 * sizeof(unsigned long)); | 131 | crc_table = (unsigned long *) malloc(256 * sizeof(unsigned long)); |
130 | 132 | ||
131 | /* Compute and print table of CRC's, five per line */ | 133 | /* Compute and print table of CRC's, five per line */ |