#ifdef L_llist_pop
/* Remove first element from the list and return it */
void *llist_pop(llist_t **head)
{
void *data;
if(!*head) data = *head;
else {
void *next = (*head)->link;
data = (*head)->data;
- *head = (*head)->link;
- free(next);
+ free(*head);
+ *head = next;
}
return data;
}
#endif
And why not added landley (c) line? ;-)
--w
vodz