Rearrange code of grow_array to make it easier to extend.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29735 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2009-09-30 07:35:33 +00:00
parent f6f8acc19a
commit aa576e8fc0
1 changed files with 3 additions and 2 deletions

View File

@ -211,8 +211,9 @@ extern int dvdsub_id;
static void grow_array(void *arrayp, int nelem, size_t elsize) {
void **array = arrayp;
void *oldp = *array;
if (!(nelem & 31))
*array = realloc(*array, (nelem + 32) * elsize);
if (nelem & 31)
return;
*array = realloc(*array, (nelem + 32) * elsize);
if (!*array)
free(oldp);
}