fix compiler warnings

Fix -Wchar-subscripts warnings on NetBSD and warnings about pointer
aliasing and uninitialized values with an older compiler.
This commit is contained in:
Miroslav Lichvar
2020-10-06 08:59:56 +02:00
parent 4779adcb50
commit 48709d9c4a
5 changed files with 10 additions and 8 deletions

View File

@@ -196,7 +196,7 @@ process_response(NKC_Instance inst)
inst->server_name[length] = '\0';
/* Make sure the name is printable and has no spaces */
for (i = 0; i < length && isgraph(inst->server_name[i]); i++)
for (i = 0; i < length && isgraph((unsigned char)inst->server_name[i]); i++)
;
if (i != length) {
DEBUG_LOG("Invalid server name");