Fix cppcheck warnings

pull/345/head
Michael Black W9MDB 2020-07-04 07:17:45 -05:00
rodzic b2dce86e91
commit ed3a26296d
1 zmienionych plików z 7 dodań i 10 usunięć

Wyświetl plik

@ -290,7 +290,7 @@ static char *mystrtok(char *s, char delim)
{
}
if (str[ pos + 1 ] == '\0')
if (str && str[ pos + 1 ] == '\0')
{
return NULL;
}
@ -1038,6 +1038,11 @@ int find_on_list(char **list, char *what)
return -1;
}
if (!list[i])
{
return -1;
}
while (list[i] != NULL)
{
if (strcmp(list[i], what) == 0)
@ -1049,13 +1054,5 @@ int find_on_list(char **list, char *what)
i++;
}
}
if (!list[i])
{
return -1;
}
else
{
return i;
}
return i;
}