Code:
char line2[1024]; <-- Memory
Just make an array that can hold all of the lines in the file:
Code:
char lines[5][1024]; /* Magic! */