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:
committed by
Ondřej Surý
parent
5ec65ab5d0
commit
29caa6d1f0
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user