X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_xline_db.cpp;h=2237b0d081e8036217606e7a3c22de29d7b0942e;hb=a5d110282a864fd2e91b51ce360a977cd0643657;hp=1c51258053928563b7ac3ae0c2fadb9408fac3ba;hpb=e55cafb93f4d98ac0a890416bf18be8e3e76affc;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_xline_db.cpp b/src/modules/m_xline_db.cpp index 1c5125805..2237b0d08 100644 --- a/src/modules/m_xline_db.cpp +++ b/src/modules/m_xline_db.cpp @@ -147,12 +147,7 @@ class ModuleXLineDB : public Module } #ifdef _WIN32 - if (remove(xlinedbpath.c_str())) - { - ServerInstance->Logs->Log("m_xline_db",DEBUG, "xlinedb: Cannot remove old database! %s (%d)", strerror(errno), errno); - ServerInstance->SNO->WriteToSnoMask('a', "database: cannot remove old database: %s (%d)", strerror(errno), errno); - return false; - } + remove(xlinedbpath.c_str()); #endif // Use rename to move temporary to new db - this is guarenteed not to fuck up, even in case of a crash. if (rename(xlinenewdbpath.c_str(), xlinedbpath.c_str()) < 0) @@ -169,7 +164,6 @@ class ModuleXLineDB : public Module { FILE *f; char linebuf[MAXBUF]; - unsigned int lineno = 0; f = fopen(xlinedbpath.c_str(), "r"); if (!f) @@ -201,16 +195,14 @@ class ModuleXLineDB : public Module c++; } - // Smart man might think of initing to 1, and moving this to the bottom. Don't. We use continue in this loop. - lineno++; // Inspired by the command parser. :) irc::tokenstream tokens(linebuf); int items = 0; - std::string command_p[MAXPARAMETERS]; + std::string command_p[7]; std::string tmp; - while (tokens.GetToken(tmp) && (items < MAXPARAMETERS)) + while (tokens.GetToken(tmp) && (items < 7)) { command_p[items] = tmp; items++;