summaryrefslogtreecommitdiff
path: root/arr.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-12-06 14:31:32 -0500
committerpommicket <pommicket@gmail.com>2022-12-06 14:31:32 -0500
commite47e17a810962a20d9483222ee2908071c89984c (patch)
tree5b00bed8bdf5d9389ed86c44796a9ca87a9be9de /arr.c
parent8242cd817017628db85f04ebf63cd328ec1e8eb3 (diff)
fix arr_set_len_, more future features
Diffstat (limited to 'arr.c')
-rw-r--r--arr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arr.c b/arr.c
index ae25a3c..d092e68 100644
--- a/arr.c
+++ b/arr.c
@@ -151,7 +151,7 @@ static void arr_set_len_(void **arr, size_t member_size, size_t n) {
ArrHeader *hdr = arr_hdr_(*arr);
if (n > hdr->len) {
// zero new elements
- memset((char *)hdr->data + hdr->len, 0, (n - hdr->len) * member_size);
+ memset((char *)hdr->data + hdr->len * member_size, 0, (n - hdr->len) * member_size);
}
hdr->len = (u32)n;
}