diff options
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -235,7 +235,10 @@ extern void verify_non_filename(const char *prefix, const char *name); #define ALLOC_GROW(x, nr, alloc) \ do { \ if ((nr) >= alloc) { \ - alloc = alloc_nr(alloc); \ + if (alloc_nr(alloc) < (nr)) \ + alloc = (nr); \ + else \ + alloc = alloc_nr(alloc); \ x = xrealloc((x), alloc * sizeof(*(x))); \ } \ } while(0) |