X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules.cpp;h=16459eeb4ecb3f9860ff23405f97845f3fe6125f;hb=001cd6b11eea25982973f1eb9736ab86b69eca05;hp=8396866578e0aaa15a4d16e07b7b0cd89bf7baf9;hpb=5ebb49de65a3f53730177665b5922dc3a62a94eb;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules.cpp b/src/modules.cpp index 839686657..16459eeb4 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -593,7 +593,7 @@ void ModuleManager::AddService(ServiceProvider& item) switch (item.service) { case SERVICE_COMMAND: - if (!ServerInstance->Parser->AddCommand(static_cast(&item))) + if (!ServerInstance->Parser.AddCommand(static_cast(&item))) throw ModuleException("Command "+std::string(item.name)+" already exists."); return; case SERVICE_MODE: @@ -611,7 +611,7 @@ void ModuleManager::AddService(ServiceProvider& item) case SERVICE_DATA: case SERVICE_IOHOOK: { - if ((item.name.substr(0, 5) == "mode/") || (item.name.substr(0, 6) == "umode/")) + if ((!item.name.compare(0, 5, "mode/", 5)) || (!item.name.compare(0, 6, "umode/", 6))) throw ModuleException("The \"mode/\" and the \"umode\" service name prefixes are reserved."); DataProviders.insert(std::make_pair(item.name, &item));