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

@@ -2030,7 +2030,7 @@ get_source_name(IPAddr *ip_addr, char *buf, int size)
/* Make sure the name is printable */
for (i = 0; i < size && buf[i] != '\0'; i++) {
if (!isgraph(buf[i]))
if (!isgraph((unsigned char)buf[i]))
return 0;
}