Subj : fgets function behaves weird To : borland.public.cpp.borlandcpp From : Erwin Date : Thu Oct 14 2004 01:27 pm Hello all! Some piece of software i have to maintain uses the function fgets to read a text file (how nice). The problem is that after some lines the first character, being a ", is not read! A text file as below is read. "0001457569900268" "00014575" "1" "1" "07/17/2002" "J" "000145756990027X" "00014575" "1" "1" "07/17/2002" "J" "0001457569900281" "00014575" "1" "1" "07/17/2002" "J" with the following function call: if( fgets(sBuffer,MAX_RECORD_SIZE,pFp) != NULL ) All the lines are delimited with a CR-LF (0D-0A). The fgets function reads until the LF and theCR is removed (borland implementation). When inspecting sBuffer most of the time a line is read like: "000145756990027X" "00014575" "1" "1" "07/17/2002" "J" However, sometimes a line is read like: 000145756990027X" "00014575" "1" "1" "07/17/2002" "J" Whats going on? Is this some sort of bug in the boreland fgets function? I searched on the internet for quite some time but did not find anything related to this behaviour. Thanks for any input, Erwin .