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) ...@@ -65,7 +65,7 @@ _list_qsort (mu_list_t list, mu_list_comparator_t cmp)
65 cur = list->head.next; 65 cur = list->head.next;
66 do { 66 do {
67 cur = cur->next; 67 cur = cur->next;
68 if (!cur) 68 if (cur == &list->head)
69 return; 69 return;
70 } while ((rc = cmp (list->head.next->item, cur->item)) == 0); 70 } while ((rc = cmp (list->head.next->item, cur->item)) == 0);
71 71
......