From b17fc0c2ce6581b7b48b8ffe457661b01289f8fe Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 28 Dec 2019 16:01:02 -0600 Subject: Allow dlist_terminate() to be called repeatedly on same list. --- lib/llist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/llist.c') diff --git a/lib/llist.c b/lib/llist.c index e1e6a564..45fe014d 100644 --- a/lib/llist.c +++ b/lib/llist.c @@ -109,7 +109,7 @@ void *dlist_terminate(void *list) { struct double_list *end = list; - if (!list) return 0; + if (!end || !end->prev) return 0; end = end->prev; end->next->prev = 0; -- cgit v1.2.3