You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found this when using fgets to read the config file in the 'mc' program.
When fgets reaches the end of file, it should return a NULL pointer. This works in the fab-agon-emulator, but it does not work on real hardware. The file has CRLF line endings and the last line ends with CRLF too.
fgets can read thousands of spurious lines before it finally thinks the end of file is reached for real. This increased the startup time of mc for some users to 2 minutes.
Temporary work-around: use my own function to read lines, based on fread(). fread() is known to reliably detect end of file.
FILE was opened using fopen with "r" mode ("r" for read access, text files). This converts CRLF on input to LF.
The text was updated successfully, but these errors were encountered:
Found this when using fgets to read the config file in the 'mc' program.
When fgets reaches the end of file, it should return a NULL pointer. This works in the fab-agon-emulator, but it does not work on real hardware. The file has CRLF line endings and the last line ends with CRLF too.
fgets can read thousands of spurious lines before it finally thinks the end of file is reached for real. This increased the startup time of mc for some users to 2 minutes.
Temporary work-around: use my own function to read lines, based on fread(). fread() is known to reliably detect end of file.
FILE was opened using fopen with "r" mode ("r" for read access, text files). This converts CRLF on input to LF.
The text was updated successfully, but these errors were encountered: