Browse Source

ckdb - abort code that adds an item already in a list/store

master
kanoi 10 years ago
parent
commit
3bc394ffb9
  1. 10
      src/klist.c

10
src/klist.c

@ -205,6 +205,11 @@ void _k_add_head(K_LIST *list, K_ITEM *item, KLIST_FFL_ARGS)
list->name, __func__, item->name, KLIST_FFL_PASS); list->name, __func__, item->name, KLIST_FFL_PASS);
} }
if (item->prev || item->next) {
quithere(1, "%s() added item %s still linked" KLIST_FFL,
__func__, item->name, KLIST_FFL_PASS);
}
item->prev = NULL; item->prev = NULL;
item->next = list->head; item->next = list->head;
if (list->head) if (list->head)
@ -241,6 +246,11 @@ void _k_add_tail(K_LIST *list, K_ITEM *item, KLIST_FFL_ARGS)
list->name, __func__, KLIST_FFL_PASS); list->name, __func__, KLIST_FFL_PASS);
} }
if (item->prev || item->next) {
quithere(1, "%s() added item %s still linked" KLIST_FFL,
__func__, item->name, KLIST_FFL_PASS);
}
item->prev = list->tail; item->prev = list->tail;
item->next = NULL; item->next = NULL;
if (list->tail) if (list->tail)

Loading…
Cancel
Save