From 6eda0e01bb4002be0c2632e0f2342fe449ca21bf Mon Sep 17 00:00:00 2001 From: Kimplul Date: Tue, 18 Mar 2025 19:20:31 +0200 Subject: fix off by one in vector end --- include/conts/vec.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/conts/vec.h b/include/conts/vec.h index 224d7aa..6e50854 100644 --- a/include/conts/vec.h +++ b/include/conts/vec.h @@ -130,7 +130,7 @@ static inline VEC_TYPE *VEC(begin)(struct VEC_STRUCT *v) static inline bool VEC(end)(struct VEC_STRUCT *v, VEC_TYPE *i) { - return &v->buf[v->n - 1] == i; + return &v->buf[v->n] == i; } static inline VEC_TYPE *VEC(next)(VEC_TYPE *i) -- cgit v1.2.3