]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_commands.cpp
m_spanningtree Rewrite /map
[user/henk/code/inspircd.git] / src / commands / cmd_commands.cpp
index 36408b3638ec3e3aa0eca58d3f526ca3ff157365..c456160612a57a5f70bc9ec73bd025a8ec91b91b 100644 (file)
@@ -30,7 +30,11 @@ class CommandCommands : public Command
  public:
        /** Constructor for commands.
         */
-       CommandCommands ( Module* parent) : Command(parent,"COMMANDS",0,0) { }
+       CommandCommands(Module* parent) : Command(parent,"COMMANDS",0,0)
+       {
+               Penalty = 3;
+       }
+
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
@@ -53,17 +57,14 @@ CmdResult CommandCommands::Handle (const std::vector<std::string>&, User *user)
                        continue;
 
                Module* src = i->second->creator;
-               char buffer[MAXBUF];
-               snprintf(buffer, MAXBUF, ":%s %03d %s :%s %s %d %d",
-                       ServerInstance->Config->ServerName.c_str(), RPL_COMMANDS, user->nick.c_str(),
-                       i->second->name.c_str(), src->ModuleSourceFile.c_str(),
-                       i->second->min_params, i->second->Penalty);
-               list.push_back(buffer);
+               list.push_back(InspIRCd::Format(":%s %03d %s :%s %s %d %d", ServerInstance->Config->ServerName.c_str(),
+                       RPL_COMMANDS, user->nick.c_str(), i->second->name.c_str(), src->ModuleSourceFile.c_str(),
+                       i->second->min_params, i->second->Penalty));
        }
        sort(list.begin(), list.end());
        for(unsigned int i=0; i < list.size(); i++)
                user->Write(list[i]);
-       user->WriteNumeric(RPL_COMMANDSEND, "%s :End of COMMANDS list",user->nick.c_str());
+       user->WriteNumeric(RPL_COMMANDSEND, ":End of COMMANDS list");
        return CMD_SUCCESS;
 }