Fixed vector_push_back() call to use memmove() instead of memcpy() - allows for region overlap

This commit is contained in:
2026-08-19 22:15:16 +02:00
parent 195e133303
commit 8af8473c72
+1 -1
View File
@@ -353,7 +353,7 @@ static inline int vector_push_back(vector_t* vec, const void* element) {
} }
// Copy the new element into the vector's data array // Copy the new element into the vector's data array
memcpy((char*)vec->data + (vec->size * vec->element_size), element, vec->element_size); memmove((char*)vec->data + (vec->size * vec->element_size), element, vec->element_size);
vec->size++; vec->size++;
return 0; // Success return 0; // Success