From 54d665b04f7fa04d240525fbf7b8a9765771e9ab 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 b4e6c047..69a3d84f 100644 --- a/Quake/common.c +++ b/Quake/common.c @@ -188,7 +188,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; }