diff options
Diffstat (limited to 'src/vec.h')
-rw-r--r-- | src/vec.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -99,10 +99,10 @@ static inline void VEC(reserve)(struct VEC_STRUCT *v, size_t n) return; v->n = n; - if (v->s < v->n) { + while (v->s < v->n) v->s *= 2; - v->buf = realloc(v->buf, v->s * sizeof(VEC_TYPE)); - } + + v->buf = realloc(v->buf, v->s * sizeof(VEC_TYPE)); } static inline void VEC(shrink)(struct VEC_STRUCT *v, size_t n) |