From a698b7342b0044530127a3f94ddea5e2eafdfcf5 Mon Sep 17 00:00:00 2001 From: Andrei Drexler Date: Tue, 26 Nov 2024 21:58:01 +0100 Subject: [PATCH] Fix destination offset in Vec_Append when element_size > 1 --- Quake/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Quake/common.c b/Quake/common.c index cd25e894b..f23ed4ced 100644 --- a/Quake/common.c +++ b/Quake/common.c @@ -191,7 +191,7 @@ void Vec_Append (void **pvec, size_t element_size, const void *data, size_t coun if (!count) return; Vec_Grow (pvec, element_size, count); - memcpy ((byte *)*pvec + VEC_HEADER(*pvec).size, data, count * element_size); + memcpy ((byte *)*pvec + VEC_HEADER(*pvec).size * element_size, data, count * element_size); VEC_HEADER(*pvec).size += count; }