diff options
author | Timothy Arceri <[email protected]> | 2017-01-11 15:13:35 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-01-12 13:58:32 +1100 |
commit | 0252ba26c545a9752b158470cb66741df0f222ce (patch) | |
tree | 010754e3da0e8d5445e2c9c3c5486f3e66438a7f /src/util | |
parent | 5857858aa6c869f4eed31029a376876f50bd6a62 (diff) |
util: fix list_is_singular()
Currently its dependant on the user calling and checking the result
of list_empty() before using the result of list_is_singular().
Cc: "13.0" <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/list.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/list.h b/src/util/list.h index e8a99ac8e00..07eb9f3e6aa 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) |