diff options
-rw-r--r-- | shared/nm-glib-aux/nm-shared-utils.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/shared/nm-glib-aux/nm-shared-utils.c b/shared/nm-glib-aux/nm-shared-utils.c index 33749d3a1c..9bfd5ae2b8 100644 --- a/shared/nm-glib-aux/nm-shared-utils.c +++ b/shared/nm-glib-aux/nm-shared-utils.c @@ -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; + } } /*****************************************************************************/ |