c - fgets dont return NULL when no new line found -


well i'm using while loop:

while(fgets(pclientrow, 1024 , f) != null)

in other classes works ok, in 1 of them, when i'm reading file line line, won't out of loop when lines end, saw in debugger.

why it? , working in class before , dont know why keep bringing empty lines untill it's crshing..

any idea?

fgets in standard ansi c function, see documentation: here fgets read max. 1023 character next '\n' or eof. lines longer 1023 character or last line has no terminating newline.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -