shared: refactor nm_utils_g_slist_strlist_cmp() to avoid dead-code warning from Coverity

Coverity sees that "return 0" cannot be reached. Refactor the code,
to avoid the warning.
This commit is contained in:
Thomas Haller 2019-08-02 09:37:46 +02:00
parent d76df4c139
commit 8fb954b81d

View file

@ -2834,10 +2834,15 @@ nm_utils_g_slist_find_str (const GSList *list,
int
nm_utils_g_slist_strlist_cmp (const GSList *a, const GSList *b)
{
for (; a && b; a = a->next, b = b->next)
while (TRUE) {
if (!a)
return !b ? 0 : -1;
if (!b)
return 1;
NM_CMP_DIRECT_STRCMP0 (a->data, b->data);
NM_CMP_SELF (a, b);
return 0;
a = a->next;
b = b->next;
}
}
/*****************************************************************************/