From 43e0b84b9c82e1fbe5ff96b15a472106cea24e05 Mon Sep 17 00:00:00 2001 From: Jean-Roland Date: Tue, 10 Dec 2024 15:49:52 +0100 Subject: [PATCH] fix: svec copy init --- src/collections/vec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/collections/vec.c b/src/collections/vec.c index c03f18f09..733267e5b 100644 --- a/src/collections/vec.c +++ b/src/collections/vec.c @@ -171,8 +171,7 @@ void _z_svec_move(_z_svec_t *dst, _z_svec_t *src) { z_result_t _z_svec_copy(_z_svec_t *dst, const _z_svec_t *src, z_element_copy_f copy, size_t element_size, bool use_elem_f) { - dst->_capacity = 0; - dst->_len = 0; + *dst = _z_svec_null(); dst->_val = z_malloc(element_size * src->_capacity); if (dst->_val == NULL) { return _Z_ERR_SYSTEM_OUT_OF_MEMORY;