aboutsummaryrefslogtreecommitdiff
path: root/src/xz/list.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2019-06-24 00:12:38 +0300
committerLasse Collin <lasse.collin@tukaani.org>2019-06-24 00:12:38 +0300
commit50120deb0159fcb53ee1a6caffb2bb81a1ecd990 (patch)
tree67c55629bf2b2437a30e34998d219b88de9a1c93 /src/xz/list.c
parenttuklib_mbstr_width: Fix a warning from -Wsign-conversion. (diff)
downloadxz-50120deb0159fcb53ee1a6caffb2bb81a1ecd990.tar.xz
xz: list.c: Fix some warnings from -Wsign-conversion.
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",