Bugfixes.
* mailbox/listlist.c (mu_list_append_list) (mu_list_prepend_list): Initialize head.next and head.prev if the destination list was empty. * mailbox/freeitem.c: Include stdlib.h. * mailbox/list.c: Minor style fix.
Showing
3 changed files
with
4 additions
and
1 deletions
... | @@ -359,7 +359,7 @@ mu_list_do (mu_list_t list, mu_list_action_t *action, void *cbdata) | ... | @@ -359,7 +359,7 @@ mu_list_do (mu_list_t list, mu_list_action_t *action, void *cbdata) |
359 | 359 | ||
360 | if (list == NULL || action == NULL) | 360 | if (list == NULL || action == NULL) |
361 | return EINVAL; | 361 | return EINVAL; |
362 | status = mu_list_get_iterator(list, &itr); | 362 | status = mu_list_get_iterator (list, &itr); |
363 | if (status) | 363 | if (status) |
364 | return status; | 364 | return status; |
365 | for (mu_iterator_first (itr); !mu_iterator_is_done (itr); | 365 | for (mu_iterator_first (itr); !mu_iterator_is_done (itr); | ... | ... |
... | @@ -107,6 +107,7 @@ mu_list_append_list (mu_list_t list, mu_list_t new_list) | ... | @@ -107,6 +107,7 @@ mu_list_append_list (mu_list_t list, mu_list_t new_list) |
107 | if (list->count == 0) | 107 | if (list->count == 0) |
108 | { | 108 | { |
109 | list->head = new_list->head; | 109 | list->head = new_list->head; |
110 | list->head.next->prev = list->head.prev->next = &list->head; | ||
110 | list->count = new_list->count; | 111 | list->count = new_list->count; |
111 | } | 112 | } |
112 | else | 113 | else |
... | @@ -123,6 +124,7 @@ mu_list_prepend_list (mu_list_t list, mu_list_t new_list) | ... | @@ -123,6 +124,7 @@ mu_list_prepend_list (mu_list_t list, mu_list_t new_list) |
123 | if (list->count == 0) | 124 | if (list->count == 0) |
124 | { | 125 | { |
125 | list->head = new_list->head; | 126 | list->head = new_list->head; |
127 | list->head.next->prev = list->head.prev->next = &list->head; | ||
126 | list->count = new_list->count; | 128 | list->count = new_list->count; |
127 | } | 129 | } |
128 | else | 130 | else | ... | ... |
-
Please register or sign in to post a comment