aboutsummaryrefslogtreecommitdiffstats
path: root/src/badlib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/badlib.h')
-rw-r--r--src/badlib.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/badlib.h b/src/badlib.h
index 71f4bee..4944d2e 100644
--- a/src/badlib.h
+++ b/src/badlib.h
@@ -832,6 +832,9 @@ _array_maybe_grow(void *arr, sz type_size, Arena *a) {
832 832
833static inline char * 833static inline char *
834_array_insert(char *arr, const char *src, sz n_bytes, sz type_size, Arena *a) { 834_array_insert(char *arr, const char *src, sz n_bytes, sz type_size, Arena *a) {
835 if (!arr) {
836 arr = _array_reserve(0, 0, a);
837 }
835 ArrayHeader *head = array_head(arr); 838 ArrayHeader *head = array_head(arr);
836 sz new_size = n_bytes + head->size; 839 sz new_size = n_bytes + head->size;
837 if (new_size > head->cap * type_size) { 840 if (new_size > head->cap * type_size) {