summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/util/list.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/list.h b/src/util/list.h
index e8a99ac8e0..07eb9f3e6a 100644
--- a/src/util/list.h
+++ b/src/util/list.h
@@ -110,7 +110,7 @@ static inline bool list_empty(struct list_head *list)
*/
static inline bool list_is_singular(const struct list_head *list)
{
- return list->next != NULL && list->next->next == list;
+ return list->next != NULL && list->next != list && list->next->next == list;
}
static inline unsigned list_length(struct list_head *list)