avoid potential UB when using isprint()

all the ctype.h functions' argument must be representable as an unsigned
char or as EOF, otherwise the behavior is undefined.

(cherry picked from commit af3bb68add1c40d19d0dee382009e21b0870a38f)
master
NRK 3 years ago committed by alex
parent 9edecdb144
commit 295a8f2f94

@ -374,7 +374,7 @@ static const char base64_digits[] = {
char
base64dec_getc(const char **src)
{
while (**src && !isprint(**src))
while (**src && !isprint((unsigned char)**src))
(*src)++;
return **src ? *((*src)++) : '='; /* emulate padding if string ends */
}

Loading…
Cancel
Save