mirror of
https://git.tukaani.org/xz.git
synced 2024-04-04 12:36:23 +02:00
Fix handling of integrity check type in the xz command line tool.
This commit is contained in:
parent
96c46df7de
commit
1d924e584b
2 changed files with 12 additions and 1 deletions
|
@ -294,10 +294,17 @@ parse_real(args_info *args, int argc, char **argv)
|
|||
size_t i = 0;
|
||||
while (strcmp(types[i].str, optarg) != 0) {
|
||||
if (++i == ARRAY_SIZE(types))
|
||||
message_fatal(_("%s: Unknown integrity"
|
||||
message_fatal(_("%s: Unsupported "
|
||||
"integrity "
|
||||
"check type"), optarg);
|
||||
}
|
||||
|
||||
// Use a separate check in case we are using different
|
||||
// liblzma than what was used to compile us.
|
||||
if (!lzma_check_is_supported(types[i].check))
|
||||
message_fatal(_("%s: Unsupported integrity "
|
||||
"check type"), optarg);
|
||||
|
||||
coder_set_check(types[i].check);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,11 @@ static bool preset_default = true;
|
|||
static bool preset_extreme = false;
|
||||
|
||||
/// Integrity check type
|
||||
#ifdef HAVE_CHECK_CRC64
|
||||
static lzma_check check = LZMA_CHECK_CRC64;
|
||||
#else
|
||||
static lzma_check check = LZMA_CHECK_CRC32;
|
||||
#endif
|
||||
|
||||
|
||||
extern void
|
||||
|
|
Loading…
Reference in a new issue