I have used fgets as well as fscanf to read a file line by line but all the time I have got some wrong output.
1st line of the file contain 149 characters and 2nd line contains 122 characters, but in my output file it shows 1st line contain 149 but 2nd line contain 128.
Cthat extra 6 chars are normal, it just tells that you did not truncate the data with\nand you are getting garbage chars. - balexandre