commit 6b63b6ef58c0628f2ac0918d916595778b6db391
parent 0363b2221d375160db213880a0fd41b67373f1fb
Author: Mahdi Mirzade <[email protected]>
Date: Tue, 12 Apr 2022 14:53:33 +0430
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.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/st.c b/st.c
@@ -408,7 +408,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 */
}