diff --git a/core/cfg/ini.cpp b/core/cfg/ini.cpp index 92e7af6d7..285f3ff84 100644 --- a/core/cfg/ini.cpp +++ b/core/cfg/ini.cpp @@ -198,8 +198,7 @@ void ConfigFile::parse(FILE* file) int cline = 0; while(file && !feof(file)) { - fgets(line, 512, file); - if (feof(file)) + if (fgets(line, 512, file) == NULL || feof(file)) { break; }