]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/configparser.cpp
m_callerid Remove redundant includes
[user/henk/code/inspircd.git] / src / configparser.cpp
index 056ed54a4b3e5fb019d88122f1359c4fee06e448..a8e36f6e0048c1c1c2a91a719ee81d575dcccbcb 100644 (file)
@@ -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)
-                       cache.push_back(std::string(linebuf, len - 1));
+               {
+                       if (linebuf[len-1] == '\n')
+                               len--;
+                       cache.push_back(std::string(linebuf, len));
+               }
        }
 }