ta_talloc: fix assert in MP_TARRAY_REMOVE_AT

The index must be strictly less than the number of elements.
This commit is contained in:
llyyr
2026-10-13 09:43:27 +05:30
committed by Kacper Michajłow
parent b413ad0258
commit 270367e8af
+1 -1
View File
@@ -142,7 +142,7 @@ char *ta_talloc_asprintf_append_buffer(char *s, const char *fmt, ...) TA_PRF(2,
#define MP_TARRAY_REMOVE_AT(p, idxvar, at) \
do { \
size_t at_ = (at); \
assert(at_ <= (idxvar)); \
assert(at_ < (idxvar)); \
memmove((p) + at_, (p) + at_ + 1, \
((idxvar) - at_ - 1) * sizeof((p)[0])); \
(idxvar)--; \