orhun / kermit

A VTE-based, simple and froggy terminal emulator 🐸
GNU General Public License v3.0
134 stars 8 forks source link

Fix wrong usage of feof #9

Closed markand closed 4 years ago

markand commented 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.

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.

orhun commented 4 years ago

Hey,

Thanks for pointing out and fixing this issue. Also it's good to learn this detail :+1: