[fix] accept 0 for array_new_size

This commit is contained in:
Al
2017-01-13 17:49:31 -05:00
parent e1f258171f
commit 1398df1260

View File

@@ -34,7 +34,7 @@ static inline void _aligned_free(void *p)
name *array = malloc(sizeof(name)); \
if (array == NULL) return NULL; \
array->n = array->m = 0; \
array->a = malloc(size * sizeof(type)); \
array->a = malloc((size > 0 ? size : 1) * sizeof(type)); \
if (array->a == NULL) return NULL; \
array->m = size; \
return array; \