diff options
Diffstat (limited to 'src/configparser.cpp')
-rw-r--r-- | src/configparser.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp index 51d67b4f5..a8e36f6e0 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -317,9 +317,13 @@ void ParseStack::DoReadFile(const std::string& key, const std::string& name, int char linebuf[MAXBUF*10]; while (fgets(linebuf, sizeof(linebuf), file)) { - int len = strlen(linebuf); + size_t len = strlen(linebuf); if (len) + { + if (linebuf[len-1] == '\n') + len--; cache.push_back(std::string(linebuf, len)); + } } } |