Add casts for isxdigit and isspace.

The argument must be representable as an unsigned char or EOF.
This commit is contained in:
Joris Vink 2020-09-08 19:19:56 +02:00
parent 4498270bbe
commit aaf8be40c2
2 changed files with 3 additions and 2 deletions

View File

@ -1120,7 +1120,7 @@ cli_build_asset(char *fpath, struct dirent *dp)
/* Replace dots, spaces, etc etc with underscores. */
for (p = name; *p != '\0'; p++) {
if (*p == '.' || isspace(*p) || *p == '-')
if (*p == '.' || isspace((unsigned char)*p) || *p == '-')
*p = '_';
}

View File

@ -1002,7 +1002,8 @@ http_argument_urldecode(char *arg)
return (KORE_RESULT_ERROR);
}
if (!isxdigit(*(p + 1)) || !isxdigit(*(p + 2))) {
if (!isxdigit((unsigned char)*(p + 1)) ||
!isxdigit((unsigned char)*(p + 2))) {
*in++ = *p++;
continue;
}