summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2025-03-18 19:20:31 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2025-03-18 19:20:31 +0200
commit6eda0e01bb4002be0c2632e0f2342fe449ca21bf (patch)
treebbaa9e46971da181f20b864e1b184d11a8b51f31
parent3e91f337a5678da40a61fb950e44543d32781adc (diff)
downloadconts-6eda0e01bb4002be0c2632e0f2342fe449ca21bf.tar.gz
conts-6eda0e01bb4002be0c2632e0f2342fe449ca21bf.zip
fix off by one in vector end
-rw-r--r--include/conts/vec.h2
1 files changed, 1 insertions, 1 deletions
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)