diff options
-rw-r--r-- | src/configreader.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index 7a7934f16..d0fff119f 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -1301,8 +1301,9 @@ bool ServerConfig::LoadConf(ConfigDataHash &target, FILE* &conf, const char* fil include_stack.push_back(filename); /* Start reading characters... */ - while ((ch = fgetc(conf))) + while (!feof(conf)) { + ch = fgetc(conf); /* * Fix for moronic windows issue spotted by Adremelech. @@ -1360,8 +1361,9 @@ bool ServerConfig::LoadConf(ConfigDataHash &target, FILE* &conf, const char* fil { line += ch; char real_character; - if ((real_character = fgetc(conf))) + if (!feof(conf)) { + real_character = fgetc(conf); if (real_character == 'n') real_character = '\n'; line += real_character; |