(find_cells): work around broken realloc

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4042 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-11-18 16:14:30 +00:00
parent 87b2f93f59
commit c4b062f219

View File

@@ -172,7 +172,10 @@ find_cells(char *file, char ***cells, int *index)
if(strcmp((*cells)[i], cell) == 0)
break;
if(i == *index){
*cells = realloc(*cells, (*index + 1) * sizeof(**cells));
if(*cells == NULL)
*cells = malloc((*index + 1) * sizeof(**cells));
else
*cells = realloc(*cells, (*index + 1) * sizeof(**cells));
(*cells)[(*index)++] = strdup(cell);
}
}