Closed markand closed 4 years ago
Hi,
The C function feof can only be used after at least one I/O operation and cannot be used immediately after fopen.
fopen
This is a common mistake that I simply fixed by checking the result of fgets which is usually enough.
fgets
While here, since the function always return 0 and its result code is never tested I simply removed it and reduced indent level.
Hey,
Thanks for pointing out and fixing this issue. Also it's good to learn this detail :+1:
Hi,
The C function feof can only be used after at least one I/O operation and cannot be used immediately after
fopen
.This is a common mistake that I simply fixed by checking the result of
fgets
which is usually enough.While here, since the function always return 0 and its result code is never tested I simply removed it and reduced indent level.