From 2e28e57be85ecaea5aa58fd2f6a7f826d6b46101 Mon Sep 17 00:00:00 2001 From: Stefanos Kornilios Mitsis Poiitidis Date: Mon, 24 Aug 2015 14:04:23 +0200 Subject: [PATCH] cfg/ini: Handle empty ini files --- core/cfg/ini.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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; }