diff options
Diffstat (limited to 'archival/lzop.c')
-rw-r--r-- | archival/lzop.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/archival/lzop.c b/archival/lzop.c index 0a15c51aa..ab4d34c88 100644 --- a/archival/lzop.c +++ b/archival/lzop.c | |||
@@ -475,7 +475,7 @@ lzo_crc32(uint32_t c, const uint8_t* buf, unsigned len) | |||
475 | 475 | ||
476 | crc = ~c; | 476 | crc = ~c; |
477 | if (len != 0) do { | 477 | if (len != 0) do { |
478 | crc = G.lzo_crc32_table[((int)crc ^ *buf) & 0xff] ^ (crc >> 8); | 478 | crc = G.lzo_crc32_table[(uint8_t)((int)crc ^ *buf)] ^ (crc >> 8); |
479 | buf += 1; | 479 | buf += 1; |
480 | len -= 1; | 480 | len -= 1; |
481 | } while (len > 0); | 481 | } while (len > 0); |
@@ -738,12 +738,12 @@ static NOINLINE smallint lzo_decompress(const header_t *h) | |||
738 | bb_error_msg_and_die("this file is a split lzop file"); | 738 | bb_error_msg_and_die("this file is a split lzop file"); |
739 | 739 | ||
740 | if (dst_len > MAX_BLOCK_SIZE) | 740 | if (dst_len > MAX_BLOCK_SIZE) |
741 | bb_error_msg_and_die("lzop file corrupted"); | 741 | bb_error_msg_and_die("corrupted data"); |
742 | 742 | ||
743 | /* read compressed block size */ | 743 | /* read compressed block size */ |
744 | src_len = read32(); | 744 | src_len = read32(); |
745 | if (src_len <= 0 || src_len > dst_len) | 745 | if (src_len <= 0 || src_len > dst_len) |
746 | bb_error_msg_and_die("lzop file corrupted"); | 746 | bb_error_msg_and_die("corrupted data"); |
747 | 747 | ||
748 | if (dst_len > block_size) { | 748 | if (dst_len > block_size) { |
749 | if (b2) { | 749 | if (b2) { |
@@ -797,7 +797,7 @@ static NOINLINE smallint lzo_decompress(const header_t *h) | |||
797 | r = lzo1x_decompress_safe(b1, src_len, b2, &d, NULL); | 797 | r = lzo1x_decompress_safe(b1, src_len, b2, &d, NULL); |
798 | 798 | ||
799 | if (r != 0 /*LZO_E_OK*/ || dst_len != d) { | 799 | if (r != 0 /*LZO_E_OK*/ || dst_len != d) { |
800 | bb_error_msg_and_die("corrupted compressed data"); | 800 | bb_error_msg_and_die("corrupted data"); |
801 | } | 801 | } |
802 | dst = b2; | 802 | dst = b2; |
803 | } else { | 803 | } else { |
@@ -1042,7 +1042,7 @@ static smallint do_lzo_decompress(void) | |||
1042 | return lzo_decompress(&header); | 1042 | return lzo_decompress(&header); |
1043 | } | 1043 | } |
1044 | 1044 | ||
1045 | static char* make_new_name_lzop(char *filename) | 1045 | static char* FAST_FUNC make_new_name_lzop(char *filename, const char *expected_ext UNUSED_PARAM) |
1046 | { | 1046 | { |
1047 | if (option_mask32 & OPT_DECOMPRESS) { | 1047 | if (option_mask32 & OPT_DECOMPRESS) { |
1048 | char *extension = strrchr(filename, '.'); | 1048 | char *extension = strrchr(filename, '.'); |
@@ -1054,7 +1054,7 @@ static char* make_new_name_lzop(char *filename) | |||
1054 | return xasprintf("%s.lzo", filename); | 1054 | return xasprintf("%s.lzo", filename); |
1055 | } | 1055 | } |
1056 | 1056 | ||
1057 | static IF_DESKTOP(long long) int pack_lzop(unpack_info_t *info UNUSED_PARAM) | 1057 | static IF_DESKTOP(long long) int FAST_FUNC pack_lzop(unpack_info_t *info UNUSED_PARAM) |
1058 | { | 1058 | { |
1059 | if (option_mask32 & OPT_DECOMPRESS) | 1059 | if (option_mask32 & OPT_DECOMPRESS) |
1060 | return do_lzo_decompress(); | 1060 | return do_lzo_decompress(); |
@@ -1074,5 +1074,5 @@ int lzop_main(int argc UNUSED_PARAM, char **argv) | |||
1074 | option_mask32 |= OPT_DECOMPRESS; | 1074 | option_mask32 |= OPT_DECOMPRESS; |
1075 | 1075 | ||
1076 | G.lzo_crc32_table = crc32_filltable(NULL, 0); | 1076 | G.lzo_crc32_table = crc32_filltable(NULL, 0); |
1077 | return bbunpack(argv, make_new_name_lzop, pack_lzop); | 1077 | return bbunpack(argv, pack_lzop, make_new_name_lzop, /*unused:*/ NULL); |
1078 | } | 1078 | } |