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

@@ -535,7 +535,7 @@ get_cstr_zones(const char *cstr, trpz_rsp_t *trsp, size_t *pnzones) {
while (tptr != NULL && *tptr != '\0') {
tok = strsep(&tptr, ";\n");
while (isspace(*tok)) {
while (isspace((unsigned char)*tok)) {
tok++;
}
@@ -547,7 +547,7 @@ get_cstr_zones(const char *cstr, trpz_rsp_t *trsp, size_t *pnzones) {
tok += 5;
while (isspace(*tok)) {
while (isspace((unsigned char)*tok)) {
tok++;
}
@@ -570,7 +570,8 @@ get_cstr_zones(const char *cstr, trpz_rsp_t *trsp, size_t *pnzones) {
qend = tok;
}
while (*qend != '\0' && !isspace(*qend)) {
while (*qend != '\0' && !isspace((unsigned char)*qend))
{
qend++;
}