mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
Use the correct algorithm for the new defspace size.
While the result was correct, space->size >= space->size is always true and thus grow_space would unconditionally increase the defspace's size.
This commit is contained in:
parent
d340aac2eb
commit
c7b2996798
1 changed files with 5 additions and 6 deletions
|
@ -69,12 +69,11 @@ grow_space (defspace_t *space)
|
|||
{
|
||||
int size;
|
||||
|
||||
if (space->size >= space->size) {
|
||||
size = space->size + GROW;
|
||||
size -= size % GROW;
|
||||
} else {
|
||||
size = space->max_size + GROW;
|
||||
}
|
||||
if (space->size <= space->max_size)
|
||||
return 1;
|
||||
|
||||
size = space->size + GROW;
|
||||
size -= size % GROW;
|
||||
space->data = realloc (space->data, size * sizeof (pr_type_t));
|
||||
memset (space->data + space->max_size, 0, GROW * sizeof (pr_type_t));
|
||||
space->max_size = size;
|
||||
|
|
Loading…
Reference in a new issue