Bugfix in mu_list_sort.
* libmailutils/list/sort.c (_list_qsort): Fix end-of-list condition.
Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -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 | ... | ... |
-
Please register or sign in to post a comment