From: Paul Eggert Date: Tue, 13 Aug 2024 06:26:41 +0000 (-0700) Subject: Remove cast from from_header X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=b201a3742162adcb2cf1e9618c4c4f4db0d239ae;p=thirdparty%2Ftar.git Remove cast from from_header * src/list.c (from_header): Reword to avoid a cast to unsigned char. --- 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)