Prima cosa: perchè se c'è un errore nell' apertura del file non esci dal programma?
Poi a che serve quella fseek dopo il secondo if?