summaryrefslogtreecommitdiff
path: root/ds.c
diff options
context:
space:
mode:
Diffstat (limited to 'ds.c')
-rw-r--r--ds.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ds.c b/ds.c
index 99ad4d3..b599f36 100644
--- a/ds.c
+++ b/ds.c
@@ -100,6 +100,8 @@ static void arr_reserve_(void **arr, size_t member_size, size_t n) {
if (*arr) free(arr_hdr_(*arr));
*arr = NULL;
}
+
+ if (n == 0) return;
if (!*arr) {
// create a new array with capacity n+1