line = 0;
while(fgets(buf, sizeof buf, fp)
{
log[line] = malloc(strlen(buf) + 1);
strcpy(log[line], buf);
line++;
}