Fix error: array subscript has type 'char'

Use unsigned char variable, or cast to (unsigned char), for
tolower()/islower() and friends. Fix compiler error
array subscript has type 'char' [-Werror=char-subscripts]

Signed-off-by: Manuel Bouyer <bouyer@netbsd.org>
Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
Manuel Bouyer authored and Ian Jackson committed 2021-01-28 16:36:48 +00:00
1 parent 6e20463780
commit e8524e4d4d
3 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -1249,7 +1249,7 @@ static int qmp_error_class_to_libxl_error_code(libxl__gc *gc,
se++;
continue;
}
if (tolower(*s) != tolower(*se))
if (tolower((unsigned char)*s) != tolower((unsigned char)*se))
break;
s++, se++;
}
+1 -1
View File
@@ -957,7 +957,7 @@ static int parse_cpumask_range(const char *mask_str, xc_cpumap_t map)
{
unsigned int a, b;
int nmaskbits;
char c;
unsigned char c;
int in_range;
const char *s;
+2 -2
View File
@@ -173,11 +173,11 @@ static int read_symbol(FILE *in, struct sym_entry *s)
/* include the type field in the symbol name, so that it gets
* compressed together */
s->len = strlen(str) + 1;
if (islower(stype) && filename)
if (islower((unsigned char)stype) && filename)
s->len += strlen(filename) + 1;
s->sym = malloc(s->len + 1);
sym = SYMBOL_NAME(s);
if (islower(stype) && filename) {
if (islower((unsigned char)stype) && filename) {
sym = stpcpy(sym, filename);
*sym++ = '#';
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.