From 958ab0b5ee638a16d2cdbb836de02b45637170a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Mon, 28 Dec 2020 12:31:51 +0100 Subject: [PATCH] :bug: Fix Array.remove --- src/lib/array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/array.c b/src/lib/array.c index dd824abc..21da4fc6 100644 --- a/src/lib/array.c +++ b/src/lib/array.c @@ -102,7 +102,7 @@ ANN void m_vector_rem(const M_Vector v, m_uint index) { const m_uint size = ARRAY_SIZE(v); if(index < ARRAY_LEN(v) - 1) memmove(ARRAY_PTR(v) + index * size, ARRAY_PTR(v) + (index + 1) * size, - (ARRAY_SIZE(v) - index - 1) *size); + (ARRAY_LEN(v) - index - 1) *size); --ARRAY_LEN(v); if(ARRAY_LEN(v) < ARRAY_CAP(v) / 2) { const m_uint cap = ARRAY_CAP(v) /= 2; -- 2.43.0