commit a1eba38afd00c5c8be0a6c66684c7ace10afb3e5
parent e25f7bbf238b47675c922428abdb6c638e1a01e0
Author: Louis Burda <quent.burda@gmail.com>
Date: Mon, 14 Feb 2022 12:42:50 +0100
Make LIST_INNER macro independent of list
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/list.h b/include/list.h
@@ -9,8 +9,8 @@
#define LINK_EMPTY ((struct link) { 0 })
-#define LIST_INNER(list, link) \
- (((link) != &(list)->head) && ((link) != &(list)->tail))
+#define LIST_INNER(link) \
+ ((link) != NULL && (link)->prev != NULL && (link)->next != NULL)
#define LIST_ITER(list, iter) (iter) = (list)->head.next; \
(iter) != &(list)->tail; (iter) = (iter)->next