summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimothy Arceri <timothy.arceri@collabora.com>2017-01-11 15:13:35 +1100
committerTimothy Arceri <timothy.arceri@collabora.com>2017-01-12 13:58:32 +1100
commit0252ba26c545a9752b158470cb66741df0f222ce (patch)
tree010754e3da0e8d5445e2c9c3c5486f3e66438a7f /src
parent5857858aa6c869f4eed31029a376876f50bd6a62 (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.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)