That looks pretty close.
Remember that just because fgets() did not return NULL does NOT mean that it read a complete input line. (It is possible for fgets to return with a partial line of data if there is a partial line of data at the end of the file.)
Reputation Points: 344
Solved Threads: 116
Practically a Master Poster
Offline 670 posts
since May 2008