(tar_from_header): reword to avoid a cast to unsigned char.

Sync with GNU tar b201a3742162adcb2cf1e9618c4c4f4db0d239ae.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2024-09-02 10:02:58 +03:00
parent b6483b8a47
commit aadedc361d

View File

@ -432,12 +432,18 @@ tar_from_header (const char *where0, size_t digs, char const *type, intmax_t min
/* 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 tar releases. */
int dig;
negative = *where++ == '-';
while (where != lim && (dig = base64_map[(unsigned char) *where]) < 64)
while (where != lim)
{
unsigned char uc = *where;
int dig;
dig = base64_map[uc];
if (64 <= dig)
break;
if (ckd_mul (&value, value, 64))
return (-1);
value |= dig;