1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-18 02:55:12 +00:00

Arguments to character-handling functions must be representable as an unsigned char

This commit is contained in:
su8 2018-08-14 12:07:16 +00:00 committed by GitHub
parent bbaa0e9ac8
commit 0edc80bf9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -951,7 +951,7 @@ static void generate_text() {
tmp_p = text_buffer; tmp_p = text_buffer;
while (*tmp_p != 0) { while (*tmp_p != 0) {
*tmp_p = toupper(*tmp_p); *tmp_p = toupper((unsigned char)*tmp_p);
tmp_p++; tmp_p++;
} }
} }

View File

@ -2076,7 +2076,7 @@ int extract_variable_text_internal(struct text_object *retval,
/* lowercase variable name */ /* lowercase variable name */
tmp_p = buf; tmp_p = buf;
while (*tmp_p != 0) { while (*tmp_p != 0) {
*tmp_p = tolower(*tmp_p); *tmp_p = tolower((unsigned char)*tmp_p);
tmp_p++; tmp_p++;
} }

View File

@ -1876,7 +1876,7 @@ void mpd_startFieldSearch(mpd_Connection *connection, int type) {
len = 5 + strlen(strtype) + 1; len = 5 + strlen(strtype) + 1;
connection->request = static_cast<char *>(malloc(len)); connection->request = static_cast<char *>(malloc(len));
snprintf(connection->request, len, "list %c%s", tolower(strtype[0]), snprintf(connection->request, len, "list %c%s", tolower((unsigned char)strtype[0]),
strtype + 1); strtype + 1);
} }
@ -1914,7 +1914,7 @@ void mpd_addConstraintSearch(mpd_Connection *connection, int type,
len = strlen(string) + 1 + strlen(strtype) + 2 + strlen(arg) + 2; len = strlen(string) + 1 + strlen(strtype) + 2 + strlen(arg) + 2;
connection->request = static_cast<char *>(realloc(connection->request, len)); connection->request = static_cast<char *>(realloc(connection->request, len));
snprintf(connection->request, len, "%s %c%s \"%s\"", string, snprintf(connection->request, len, "%s %c%s \"%s\"", string,
tolower(strtype[0]), strtype + 1, arg); tolower((unsigned char)strtype[0]), strtype + 1, arg);
free(string); free(string);
free(arg); free(arg);

View File

@ -168,7 +168,7 @@ void print_pid_environ(struct text_object *obj, char *p, unsigned int p_max_size
generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub); generate_text_internal(objbuf.get(), max_user_text.get(*state), *obj->sub);
if (sscanf(objbuf.get(), "%d %s", &pid, var) == 2) { if (sscanf(objbuf.get(), "%d %s", &pid, var) == 2) {
for (i = 0; var[i] != 0; i++) { for (i = 0; var[i] != 0; i++) {
var[i] = toupper(var[i]); var[i] = toupper((unsigned char)var[i]);
} }
pathstream << PROCDIR "/" << pid << "/cwd"; pathstream << PROCDIR "/" << pid << "/cwd";
buf = readfile(pathstream.str().c_str(), &total_read, 1); buf = readfile(pathstream.str().c_str(), &total_read, 1);