From b201a3742162adcb2cf1e9618c4c4f4db0d239ae Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 12 Aug 2024 23:26:41 -0700 Subject: [PATCH] Remove cast from from_header * src/list.c (from_header): Reword to avoid a cast to unsigned char. --- src/list.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/list.c b/src/list.c index 49e8e987..04005092 100644 --- a/src/list.c +++ b/src/list.c @@ -830,7 +830,6 @@ from_header (char const *where0, size_t digs, char const *type, /* Parse base-64 output produced only by tar test versions 1.13.6 (1999-08-11) through 1.13.11 (1999-08-23). Support for this will be withdrawn in future releases. */ - int dig; if (!silent) { static bool warned_once; @@ -841,9 +840,12 @@ from_header (char const *where0, size_t digs, char const *type, } } negative = *where++ == '-'; - while (where != lim - && (dig = base64_map[(unsigned char) *where]) < 64) + while (where != lim) { + unsigned char uc = *where; + int dig = base64_map[uc]; + if (64 <= dig) + break; if (ckd_mul (&value, value, 64)) { if (type && !silent) -- 2.47.2