projects
/
xonotic
/
gmqcc.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cc7e1a3
)
Less pointer dereferences
author
Dale Weiler <killfieldengine@gmail.com>
Sun, 6 Jan 2013 05:17:30 +0000
(
05:17
+0000)
committer
Dale Weiler <killfieldengine@gmail.com>
Sun, 6 Jan 2013 05:17:30 +0000
(
05:17
+0000)
correct.c
patch
|
blob
|
history
diff --git
a/correct.c
b/correct.c
index cd2ab2d9331bde1c6c1a8dd9d8743e599222a6b6..c91cf6060d47c14ff1902d7b8d559d83651be059 100644
(file)
--- 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 <
old
allocated)
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;
}