]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Convert a few missing
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 5 May 2008 02:47:50 +0000 (02:47 +0000)
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 5 May 2008 02:47:50 +0000 (02:47 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9635 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_spanningtree/fjoin.cpp
src/modules/m_spanningtree/fmode.cpp

index 34dff70198f01c828282137a66b8d951e4a4fbee..070051a9c58768604e33c180ad0fd6fec1f054f9 100644 (file)
@@ -110,19 +110,18 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
        {
                unsigned int idx = 2;
                int numpara = 1;
-               const char* modelist[64];
-               memset(&modelist,0,sizeof(modelist));
+               std::vector<std::string> modelist;
 
                // Mode parser needs to know what channel to act on.
-               modelist[0] = params[0].c_str();
+               modelist[0] = params[0];
 
                /* Remember, params[params.size() - 1] is nicklist, and we don't want to apply *that* */
                for (idx = 2; idx != (params.size() - 1); idx++)
                {
-                       modelist[numpara++] = params[idx].c_str();
+                       modelist[numpara++] = params[idx];
                }
 
-               this->Instance->SendMode(modelist, numpara, this->Instance->FakeClient);
+               this->Instance->SendMode(modelist, this->Instance->FakeClient);
        }
 
        /* Now, process every 'modes,nick' pair */
@@ -181,16 +180,16 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
        if (apply_other_sides_modes)
        {
                std::deque<std::string> stackresult;
-               const char* mode_junk[MAXMODES+2];
-               mode_junk[0] = channel.c_str();
+               std::vector<std::string> mode_junk;
+               mode_junk[0] = channel;
 
                while (modestack.GetStackedLine(stackresult))
                {
                        for (size_t j = 0; j < stackresult.size(); j++)
                        {
-                               mode_junk[j+1] = stackresult[j].c_str();
+                               mode_junk[j+1] = stackresult[j];
                        }
-                       Instance->SendMode(mode_junk, stackresult.size() + 1, Instance->FakeClient);
+                       Instance->SendMode(mode_junk, Instance->FakeClient);
                }
        }
 
@@ -210,7 +209,7 @@ bool TreeSocket::RemoveStatus(const std::string &prefix, std::deque<std::string>
        {
                irc::modestacker stack(false);
                std::deque<std::string> stackresult;
-               const char* mode_junk[MAXMODES+2];
+               std::vector<std::string> mode_junk;
                mode_junk[0] = c->name;
 
                for (char modeletter = 'A'; modeletter <= 'z'; ++modeletter)
@@ -228,9 +227,9 @@ bool TreeSocket::RemoveStatus(const std::string &prefix, std::deque<std::string>
                while (stack.GetStackedLine(stackresult))
                {
                        for (size_t j = 0; j < stackresult.size(); j++)
-                               mode_junk[j+1] = stackresult[j].c_str();
+                               mode_junk[j+1] = stackresult[j];
 
-                       Instance->SendMode(mode_junk, stackresult.size() + 1, Instance->FakeClient);
+                       Instance->SendMode(mode_junk, Instance->FakeClient);
                }
        }
        return true;
index 6fa269584b3584f8b9925651f841d10570b46029..e7209a85268e387d31130f62e16e3c7371ab8255 100644 (file)
@@ -48,10 +48,9 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p
                smode = true;                   /* Setting this flag tells us it is a server mode*/
                sourceserv = source;    /* Set sourceserv to the actual source string */
        }
-       const char* modelist[64];
+       std::vector<std::string> modelist;
        time_t TS = 0;
        int n = 0;
-       memset(&modelist,0,sizeof(modelist));
        for (unsigned int q = 0; (q < params.size()) && (q < 64); q++)
        {
                if (q == 1)
@@ -65,7 +64,7 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p
                else
                {
                        /* Everything else is fine to append to the modelist */
-                       modelist[n++] = params[q].c_str();
+                       modelist[n++] = params[q];
                }
 
        }
@@ -103,11 +102,11 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p
        {
                if (smode)
                {
-                       this->Instance->SendMode(modelist, n, who);
+                       this->Instance->SendMode(modelist, who);
                }
                else
                {
-                       this->Instance->CallCommandHandler("MODE", modelist, n, who);
+                       this->Instance->CallCommandHandler("MODE", modelist, who);
                }
                /* HOT POTATO! PASS IT ON! */
                Utils->DoOneToAllButSender(source,"FMODE",params,sourceserv);