You are not logged in.
something like that. That's the problem of lines, you don't know how long
they are, so you need to search for three '\n' chars one way or the other.
One thing to look out for with fgets() is how it handles lines longer than your
bufffer, if they're too long fgets() will return multiple times for one line.
Are you responding to some other post? If so, you should've posted in that thread, rather than start a new one...
But, on glibc systems, you can use getline() to read lines of arbitrary length into a dynamically resized buffer, so you never have the issue of fgets() truncating a line...