diff options
-rw-r--r-- | common/array.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/common/array.c b/common/array.c index 9802100..9bff748 100644 --- a/common/array.c +++ b/common/array.c @@ -48,7 +48,10 @@ maybe_expand_array (p11_array *array, if (length <= array->allocated) return true; - new_allocated = array->allocated + 16; + + new_allocated = array->allocated * 2; + if (new_allocated == 0) + new_allocated = 16; if (new_allocated < length) new_allocated = length; |