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

@@ -671,7 +671,7 @@ NSR_AddSourceByName(char *name, int port, int pool, NTP_Source_Type type,
/* Make sure the name is at least printable and has no spaces */
for (i = 0; name[i] != '\0'; i++) {
if (!isgraph(name[i]))
if (!isgraph((unsigned char)name[i]))
return NSR_InvalidName;
}