]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix more incorrect std::string::operator[] usage
authorAttila Molnar <attilamolnar@hush.com>
Sat, 13 Aug 2016 16:11:57 +0000 (18:11 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Sat, 13 Aug 2016 16:11:57 +0000 (18:11 +0200)
src/commands/cmd_list.cpp
src/commands/cmd_stats.cpp
src/modules/m_sasl.cpp

index 8a99ce3e0579a17f089b24773268a2bf4778479f..eb28fb89c0ffe09fbd5f21e1702ae1fd6f5dc89b 100644 (file)
@@ -49,7 +49,7 @@ CmdResult CommandList::Handle (const std::vector<std::string>& parameters, User
 
        user->WriteNumeric(321, "%s Channel :Users Name",user->nick.c_str());
 
-       if (parameters.size() == 1)
+       if ((parameters.size() == 1) && (!parameters[0].empty()))
        {
                if (parameters[0][0] == '<')
                {
index d547635ed37968e1931e520fad687eba0de64a3b..aa5bf44cd50dd1cb1492c00858799a540adf759b 100644 (file)
@@ -39,7 +39,7 @@ class CommandStats : public Command
  public:
        /** Constructor for stats.
         */
-       CommandStats ( Module* parent) : Command(parent,"STATS",1,2) { syntax = "<stats-symbol> [<servername>]"; }
+       CommandStats ( Module* parent) : Command(parent,"STATS",1,2) { allow_empty_last_param = false; syntax = "<stats-symbol> [<servername>]"; }
        /** Handle command.
         * @param parameters The parameters to the comamnd
         * @param pcnt The number of parameters passed to teh command
index 32c9afc79ec05e36be5eeecd07f91f6f75e94ca3..9cb5592d1f8d1e2c1af817739d02c9d7552107a3 100644 (file)
@@ -147,7 +147,7 @@ class SaslAuthenticator
 
                SendSASL(params);
 
-               if (parameters[0][0] == '*')
+               if (parameters[0].c_str()[0] == '*')
                {
                        this->Abort();
                        return false;