From: Dale Weiler Date: Sun, 6 Jan 2013 05:17:30 +0000 (+0000) Subject: Less pointer dereferences X-Git-Tag: before-library~363^2~10 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=commitdiff_plain;h=a4c1e63637eec7c2ee10475093a9dba110526eba Less pointer dereferences --- diff --git a/correct.c b/correct.c index cd2ab2d..c91cf60 100644 --- a/correct.c +++ b/correct.c @@ -457,12 +457,13 @@ static int correct_exist(char **array, size_t rows, char *ident) { static GMQCC_INLINE char **correct_known_resize(char **res, size_t *allocated, size_t size) { size_t oldallocated = *allocated; char **out; - if (size+1 < *allocated) + if (size+1 < oldallocated) return res; - *allocated += 32; - out = correct_pool_alloc(sizeof(*res) * *allocated); + out = correct_pool_alloc(sizeof(*res) * oldallocated + 32); memcpy(out, res, sizeof(*res) * oldallocated); + + *allocated += 32; return out; }