mirror of
https://github.com/LukeSmithxyz/st.git
synced 2024-11-21 23:05:59 +01:00
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.
This commit is contained in:
parent
2aefa348ba
commit
af3bb68add
1 changed files with 1 additions and 1 deletions
2
st.c
2
st.c
|
@ -367,7 +367,7 @@ static const char base64_digits[] = {
|
||||||
char
|
char
|
||||||
base64dec_getc(const char **src)
|
base64dec_getc(const char **src)
|
||||||
{
|
{
|
||||||
while (**src && !isprint(**src))
|
while (**src && !isprint((unsigned char)**src))
|
||||||
(*src)++;
|
(*src)++;
|
||||||
return **src ? *((*src)++) : '='; /* emulate padding if string ends */
|
return **src ? *((*src)++) : '='; /* emulate padding if string ends */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue