Commit afce403c afce403c36eab3eecab4db52c92e87395d86ee1e by Sergey Poznyakoff

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.
1 parent 9f2f2247
......@@ -19,6 +19,7 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdlib.h>
/* Default destroy_item function. */
void
......
......@@ -359,7 +359,7 @@ mu_list_do (mu_list_t list, mu_list_action_t *action, void *cbdata)
if (list == NULL || action == NULL)
return EINVAL;
status = mu_list_get_iterator(list, &itr);
status = mu_list_get_iterator (list, &itr);
if (status)
return status;
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)
if (list->count == 0)
{
list->head = new_list->head;
list->head.next->prev = list->head.prev->next = &list->head;
list->count = new_list->count;
}
else
......@@ -123,6 +124,7 @@ mu_list_prepend_list (mu_list_t list, mu_list_t new_list)
if (list->count == 0)
{
list->head = new_list->head;
list->head.next->prev = list->head.prev->next = &list->head;
list->count = new_list->count;
}
else
......