X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_helpop.cpp;h=bae4e73aefd1085cf1bea1e66bd7821419949c91;hb=eb4229deed0281ae566ef7e55a144e5d3183a4b2;hp=00e886cb4893829fcc9f69d3e60671a42e39392a;hpb=976b8fd690df06fa9c86d63609ec4f0ce5e9a55f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index 00e886cb4..bae4e73ae 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -17,6 +17,7 @@ #include "users.h" #include "channels.h" #include "modules.h" +#include "helperfuncs.h" // Global Vars ConfigReader *helpop; @@ -94,7 +95,7 @@ bool do_helpop(char **parameters, int pcnt, userrec *src) // FIX by brain: make the string lowercase, ConfigReader is // case sensitive char lower[MAXBUF]; - strcpy(lower,search,MAXBUF); + strlcpy(lower,search,MAXBUF); for (int t = 0; t < strlen(lower); t++) lower[t] = tolower(lower[t]); @@ -141,8 +142,8 @@ class ModuleHelpop : public Module h_file = conf->ReadValue("helpop", "file", 0); if (h_file == "") { - printf("m_helpop: Helpop file not Specified."); - exit(0); + log(DEFAULT,"m_helpop: Helpop file not Specified."); + return; } helpop = new ConfigReader(h_file); @@ -151,19 +152,18 @@ class ModuleHelpop : public Module (helpop->ReadValue("nohelpo", "line1", 0) == "") || (helpop->ReadValue("start", "line1", 0) == "")) { - printf("m_helpop: Helpop file is missing important entries. Please check the example conf."); - exit(0); + log(DEFAULT,"m_helpop: Helpop file is missing important entries. Please check the example conf."); + return; } if (!Srv->AddExtendedMode('h',MT_CLIENT,true,0,0)) { Srv->Log(DEFAULT,"Unable to claim the +h usermode."); - printf("m_helpop: Unable to claim the +h usermode!"); - exit(0); + return; } // Loads of comments, untill supported properly. - Srv->AddCommand("HELPOP",handle_helpop,0,0); + Srv->AddCommand("HELPOP",handle_helpop,0,0,"m_helpop.so"); } @@ -201,7 +201,7 @@ class ModuleHelpop : public Module virtual Version GetVersion() { - return Version(0,0,0,1); + return Version(1,0,0,1,VF_STATIC|VF_VENDOR); } };