Explicitly cast chars to unsigned chars for <ctype.h> functions

Apply the semantic patch to catch all the places where we pass 'char' to
the <ctype.h> family of functions (isalpha() and friends, toupper(),
tolower()).
This commit is contained in:
Ondřej Surý
2023-09-20 17:23:28 +02:00
committed by Ondřej Surý
parent 5ec65ab5d0
commit 29caa6d1f0
4 changed files with 17 additions and 12 deletions

View File

@@ -333,8 +333,10 @@ value_match(const struct phr_header *header, const char *match) {
limit = header->value_len - match_len + 1;
for (size_t i = 0; i < limit; i++) {
if (isspace(header->value[i])) {
while (i < limit && isspace(header->value[i])) {
if (isspace((unsigned char)header->value[i])) {
while (i < limit &&
isspace((unsigned char)header->value[i]))
{
i++;
}
continue;