--- libaitio/src/Attic/array.c 2011/04/19 21:07:32 1.1.2.1 +++ libaitio/src/Attic/array.c 2011/04/19 22:00:44 1.1.2.2 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: array.c,v 1.1.2.1 2011/04/19 21:07:32 misho Exp $ +* $Id: array.c,v 1.1.2.2 2011/04/19 22:00:44 misho Exp $ * *************************************************************************/ #include "global.h" @@ -123,14 +123,14 @@ io_arrayGrow(array_t * __restrict arr, int newNumItems free(arr->arr_data[i]); */ + arr->arr_num = newNumItems; data = realloc(arr->arr_data, arr->arr_num * sizeof(void*)); if (!data) { LOGERR; return -1; } else arr->arr_data = data; - memset(arr->arr_data + arr->arr_num, 0, n * sizeof(void*)); - arr->arr_num = newNumItems; + memset(arr->arr_data + (arr->arr_num - n), 0, n * sizeof(void*)); return 0; }