aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/xz/list.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/xz/list.c b/src/xz/list.c
index 7d2df876..364e2c14 100644
--- a/src/xz/list.c
+++ b/src/xz/list.c
@@ -292,7 +292,7 @@ init_headings(void)
// Calculate the field width for printf("%*s") so that
// the string uses .columns number of columns on a terminal.
- headings[i].fw = (int)(len + headings[i].columns - w);
+ headings[i].fw = (int)(len + (size_t)headings[i].columns - w);
}
return;
@@ -870,9 +870,10 @@ print_info_adv(xz_file_info *xfi, file_pair *pair)
// the actual check value as it is hexadecimal. However, to
// print the column heading, further calculation is needed
// to handle a translated string (it's done a few lines later).
+ assert(check_max <= LZMA_CHECK_SIZE_MAX);
const int checkval_width = my_max(
- (uint32_t)(headings[HEADING_CHECKVAL].columns),
- 2 * check_max);
+ headings[HEADING_CHECKVAL].columns,
+ (int)(2 * check_max));
// All except Check are right aligned; Check is left aligned.
printf(" %s\n %*s %*s %*s %*s %*s %*s %*s %-*s",