aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2022-03-18 16:20:54 +0600
committersinanmohd <pcmsinan@gmail.com>2023-01-12 08:21:56 +0530
commit345097cf6bcf03352a025438f28540fc6a26fc0c (patch)
treeebe88e9542abdd9737a9c3993267a1a24c962f76 /st.c
parentfb35e763cce79fefad915f44024781ac87ce4f85 (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.
Diffstat (limited to 'st.c')
-rw-r--r--st.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/st.c b/st.c
index aba8349..169442e 100644
--- a/st.c
+++ b/st.c
@@ -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 */
}