]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/command_parse.cpp
Give tons more information in the xml feed, should be enough to construct just about...
[user/henk/code/inspircd.git] / src / command_parse.cpp
index 0be458d57aad91a21da9dfc143da2050da5763ef..4c9701645fb79ab86dbf93e1420f9a4b53d21dc6 100644 (file)
@@ -50,6 +50,9 @@ int InspIRCd::PassCompare(Extensible* ex, const char* data,const char* input, co
  */
 int CommandParser::LoopCall(User* user, Command* CommandObj, const std::vector<std::string>& parameters, unsigned int splithere, unsigned int extra)
 {
+       if (splithere >= parameters.size())
+               return 0;
+
        /* First check if we have more than one item in the list, if we don't we return zero here and the handler
         * which called us just carries on as it was.
         */
@@ -99,6 +102,9 @@ int CommandParser::LoopCall(User* user, Command* CommandObj, const std::vector<s
 
 int CommandParser::LoopCall(User* user, Command* CommandObj, const std::vector<std::string>& parameters, unsigned int splithere)
 {
+       if (splithere >= parameters.size())
+               return 0;
+
        /* First check if we have more than one item in the list, if we don't we return zero here and the handler
         * which called us just carries on as it was.
         */
@@ -267,7 +273,7 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd)
         * the rfc says they shouldnt but also says the ircd should
         * discard it if they do.
         */
-       if (*command.c_str() == ':')
+       if (command[0] == ':')
                tokens.GetToken(command);
 
        while (tokens.GetToken(token) && (command_p.size() <= MAXPARAMETERS))