diff options
author | Timothy Arceri <timothy.arceri@collabora.com> | 2017-01-11 15:13:35 +1100 |
---|---|---|
committer | Timothy Arceri <timothy.arceri@collabora.com> | 2017-01-12 13:58:32 +1100 |
commit | 0252ba26c545a9752b158470cb66741df0f222ce (patch) | |
tree | 010754e3da0e8d5445e2c9c3c5486f3e66438a7f /src | |
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" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Diffstat (limited to 'src')
-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 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) |