X-Git-Url: http://git.sameswireless.fr/l2tpns.git/blobdiff_plain/d4905790250059e6dd95082a1b3cc13b7c4a6c68..72a615e7e39a3ea0b46d8c4d4704159fc973c60e:/ll.c diff --git a/ll.c b/ll.c index 2b00090..1b2acad 100644 --- a/ll.c +++ b/ll.c @@ -1,7 +1,5 @@ // L2TPNS Linked List Stuff -char const *cvs_id_ll = "$Id: ll.c,v 1.5 2004-08-13 00:02:50 fred_nerk Exp $"; - #include #include #include @@ -74,9 +72,8 @@ void ll_iterate(linked_list *l, int(*func)(void *)) for (i = l->head; i; i = i->next) { - if (i->data) - if (!func(i)) - break; + if (i->data && !func(i->data)) + break; } } @@ -107,8 +104,8 @@ void ll_delete(linked_list *l, void *data) if (i->data == data) { if (l->head == i) l->head = i->next; - if (l->end == i) l->end = i->next; - if (p) p->next = i->next; + if (l->end == i) l->end = p; + if (p) p->next = i->next; free(i); l->current = NULL; return;