diff options
| author | NRK <nrk@disroot.org> | 2022-03-18 16:20:54 +0600 |
|---|---|---|
| committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2022-03-18 12:11:27 +0100 |
| commit | af3bb68add1c40d19d0dee382009e21b0870a38f (patch) | |
| tree | b18ab790bbc7a3ac21e39ab606b7d05c9274a105 | |
| parent | make underlines and strikethroughs respect `chscale` (diff) | |
| download | st-af3bb68add1c40d19d0dee382009e21b0870a38f.tar.gz st-af3bb68add1c40d19d0dee382009e21b0870a38f.zip | |
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
| @@ -367,7 +367,7 @@ static const char base64_digits[] = { | |||
| 367 | char | 367 | char |
| 368 | base64dec_getc(const char **src) | 368 | base64dec_getc(const char **src) |
| 369 | { | 369 | { |
| 370 | while (**src && !isprint(**src)) | 370 | while (**src && !isprint((unsigned char)**src)) |
| 371 | (*src)++; | 371 | (*src)++; |
| 372 | return **src ? *((*src)++) : '='; /* emulate padding if string ends */ | 372 | return **src ? *((*src)++) : '='; /* emulate padding if string ends */ |
| 373 | } | 373 | } |
