summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2022-03-18 16:20:54 +0600
committerrafa_99 <raroma09@gmail.com>2022-03-18 14:23:43 +0000
commit1b44f3fb070c2aa1b28a8273531ab6ee521e52de (patch)
tree15759f35875fd7df604482a7f89fe9a415241d9b
parent8f9014f522ddf220cdd5447b6f77b8d064253a4f (diff)
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.
-rw-r--r--st.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/st.c b/st.c
index 54a6313..16242ee 100644
--- a/st.c
+++ b/st.c
@@ -372,7 +372,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 */
}