]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix for bug #569, thanks dz.
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 12 Jul 2008 20:24:06 +0000 (20:24 +0000)
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 12 Jul 2008 20:24:06 +0000 (20:24 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9986 e03df62e-2008-0410-955e-edbf42e46eb7

src/hashcomp.cpp
src/modules/m_operlog.cpp
src/modules/m_password_hash.cpp

index 1bcb538f6f499e37ba71788be1a9e9b7164f4cb7..18846737f1cf7a53b68f053858bafd19a714e2fb 100644 (file)
@@ -382,6 +382,9 @@ int irc::modestacker::GetStackedLine(std::deque<std::string> &result, int max_li
 
 irc::stringjoiner::stringjoiner(const std::string &seperator, const std::vector<std::string> &sequence, int begin, int end)
 {
+       if (end < begin)
+               throw "stringjoiner logic error, this causes problems.";
+
        for (int v = begin; v < end; v++)
                joined.append(sequence[v]).append(seperator);
        joined.append(sequence[end]);
@@ -389,6 +392,9 @@ irc::stringjoiner::stringjoiner(const std::string &seperator, const std::vector<
 
 irc::stringjoiner::stringjoiner(const std::string &seperator, const std::deque<std::string> &sequence, int begin, int end)
 {
+       if (end < begin)
+               throw "stringjoiner logic error, this causes problems.";
+
        for (int v = begin; v < end; v++)
                joined.append(sequence[v]).append(seperator);
        joined.append(sequence[end]);
@@ -396,6 +402,9 @@ irc::stringjoiner::stringjoiner(const std::string &seperator, const std::deque<s
 
 irc::stringjoiner::stringjoiner(const std::string &seperator, const char* const* sequence, int begin, int end)
 {
+       if (end < begin)
+               throw "stringjoiner logic error, this causes problems.";
+
        for (int v = begin; v < end; v++)
                joined.append(sequence[v]).append(seperator);
        joined.append(sequence[end]);
index 10e4503f87015aad43fc3db452b9a9223a09117d..d39beb68d1ef29e005593f2e32d02fef4ed28da6 100644 (file)
@@ -47,7 +47,7 @@ class ModuleOperLog : public Module
                {
                        Command* thiscommand = ServerInstance->Parser->GetHandler(command);
                        if ((thiscommand) && (thiscommand->flags_needed == 'o'))
-                               ServerInstance->Logs->Log("m_operlog",DEFAULT,"OPERLOG: [%s!%s@%s] %s %s",user->nick.c_str(), user->ident.c_str(), user->host.c_str(), command.c_str(), irc::stringjoiner(" ", parameters, 0, parameters.size() - 1).GetJoined().c_str());
+                               ServerInstance->Logs->Log("m_operlog",DEFAULT,"OPERLOG: [%s!%s@%s] %s %s",user->nick.c_str(), user->ident.c_str(), user->host.c_str(), command.c_str(), parameters.empty() ? "" : irc::stringjoiner(" ", parameters, 0, parameters.size() - 1).GetJoined().c_str());
                }
 
                return 0;
index 4d3a9da63dadca4a3df5fbcb8863652ba1390ced..81c2d4cac4c3ed9864df2e5a575927a05855af23 100644 (file)
@@ -45,6 +45,11 @@ class CommandMkpasswd : public Command
                        /* Now attempt to generate a hash */
                        user->WriteServ("NOTICE %s :%s hashed password for %s is %s",user->nick.c_str(), algo, stuff, HashSumRequest(Sender, x->second, stuff).Send() );
                }
+               else if (names.empty())
+               {
+                       /* same idea as bug #569 */
+                       user->WriteServ("NOTICE %s :No hash provider modules are loaded", user->nick.c_str());
+               }
                else
                {
                        /* I dont do flying, bob. */