summaryrefslogtreecommitdiff
path: root/src/array.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/array.h')
-rw-r--r--src/array.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/array.h b/src/array.h
index 7c4dbdbc1..7cd9b7153 100644
--- a/src/array.h
+++ b/src/array.h
@@ -51,10 +51,9 @@ GIT_INLINE(void *) git_array_grow(void *_a, size_t item_size)
if (a->size < 8) {
new_size = 8;
} else {
- if (GIT_ALLOC_OVERFLOW_MULTIPLY(a->size, 3 / 2))
+ if (GIT_MULTIPLY_SIZET_OVERFLOW(&new_size, a->size, 3))
goto on_oom;
-
- new_size = a->size * 3 / 2;
+ new_size /= 2;
}
if ((new_array = git__reallocarray(a->ptr, new_size, item_size)) == NULL)