aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2020-08-04 14:25:07 +0200
committerKenny Levinsen <kl@kl.wtf>2020-08-04 14:25:07 +0200
commit86efc98a5eab40631f6f02e6cdcfdd871ec08e9a (patch)
tree5282d937ee10fb9450fac4dbc99c8df5d7203952 /common
parenta844d77c21661af3742c6090a3833452021f825c (diff)
linked_list: Assert initialized list in linked_list_empty
Diffstat (limited to 'common')
-rw-r--r--common/linked_list.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/linked_list.c b/common/linked_list.c
index b853289..cb3e0a8 100644
--- a/common/linked_list.c
+++ b/common/linked_list.c
@@ -29,5 +29,6 @@ void linked_list_remove(struct linked_list *elem) {
}
bool linked_list_empty(struct linked_list *list) {
+ assert(list->prev != NULL && list->next != NULL);
return list->next == list;
}