Stick in a tonne of print statements displaying values and where its at to work out where abouts it gets to before failing then.
See i like the basic feel of C and all but i hate the lack of advanced debugging tools and friendly compilers.
Plus you don't have to post all your source maybe just a snippet or an example, 1 its really annoying when someone posts like a hundred+ lines of source and says "why don't this work" and 2 its not like you're re inventing how to read from a file. I found out a few weeks after one of my big programming project hand in dates part of my code had gone around half the year after i lent it to a friend and the lecturers were none the wiser as people just changed variable names and switched stuff around. Not that copying helped in the long run.
EDIT:
Blackdragon@ thats the second time i was typing something and made it too long and you posted what i was about to say!!!!