From c9288158bcf21981ab492566a78bacfaf28e2643 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 1 Sep 2024 11:56:38 +0300 Subject: [PATCH] (tar_from_header): minor width cleanup. Use UINTMAX_WIDTH rather than computing it by hand. Sync with GNU tar fbc60c2334326fc2f748226abe76190ecf39a26b. Signed-off-by: Andrew Borodin --- src/vfs/tar/tar-internal.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/vfs/tar/tar-internal.c b/src/vfs/tar/tar-internal.c index bccc80b3c..e4b2e2752 100644 --- a/src/vfs/tar/tar-internal.c +++ b/src/vfs/tar/tar-internal.c @@ -362,8 +362,7 @@ tar_from_header (const char *where0, size_t digs, char const *type, intmax_t min uintmax_t topbits; signbit = *where & (1 << (LG_256 - 2)); - topbits = - (((uintmax_t) - signbit) << (CHAR_BIT * sizeof (uintmax_t) - LG_256 - (LG_256 - 2))); + topbits = ((uintmax_t) - signbit) << (UINTMAX_WIDTH - LG_256 - (LG_256 - 2)); value = (*where++ & ((1 << (LG_256 - 2)) - 1)) - signbit;