Commit e20cd8ae e20cd8ae1e349af0a13008c1dc31704e64658455 by Sergey Poznyakoff

Bugfix in mu_list_sort.

* libmailutils/list/sort.c (_list_qsort): Fix end-of-list condition.
1 parent ada8b8cf
......@@ -65,7 +65,7 @@ _list_qsort (mu_list_t list, mu_list_comparator_t cmp)
cur = list->head.next;
do {
cur = cur->next;
if (!cur)
if (cur == &list->head)
return;
} while ((rc = cmp (list->head.next->item, cur->item)) == 0);
......