avoid potential UB when using isprint() - st - Personal fork of st
(HTM) git clone git://git.drkhsh.at/st.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit af3bb68add1c40d19d0dee382009e21b0870a38f
(DIR) parent 2aefa348baf4b702fdce98eb105bcba175d8283f
(HTM) Author: NRK <nrk@disroot.org>
Date: Fri, 18 Mar 2022 16:20:54 +0600
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:
M st.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
(DIR) diff --git a/st.c b/st.c
@@ -367,7 +367,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 */
}