summaryrefslogtreecommitdiffstats
path: root/src/util/u_vector.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2018-03-26 10:52:43 -0700
committerIan Romanick <[email protected]>2018-03-29 14:09:28 -0700
commitcd18aa1e50e4668c8d992816bcdb74376dd1064c (patch)
treeb0872c60db06300edeb742ecd786118c59bce4d1 /src/util/u_vector.c
parent22fbb5c5949b1590ef04b6432dd7f3a93a37c2ed (diff)
util: Use util_is_power_of_two_nonzero in u_vector
Previously size=0, element_size=0 would have been allowed. That combination can only lead to despair. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alejandro PiƱeiro <[email protected]>
Diffstat (limited to 'src/util/u_vector.c')
-rw-r--r--src/util/u_vector.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/u_vector.c b/src/util/u_vector.c
index bec6e5bbc30..15f8ed6bdad 100644
--- a/src/util/u_vector.c
+++ b/src/util/u_vector.c
@@ -37,8 +37,8 @@
int
u_vector_init(struct u_vector *vector, uint32_t element_size, uint32_t size)
{
- assert(util_is_power_of_two_or_zero(size));
- assert(element_size < size && util_is_power_of_two_or_zero(element_size));
+ assert(util_is_power_of_two_nonzero(size));
+ assert(element_size < size && util_is_power_of_two_nonzero(element_size));
vector->head = 0;
vector->tail = 0;