diff options
author | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-05-05 03:40:03 +0000 |
---|---|---|
committer | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-05-05 03:40:03 +0000 |
commit | f9ef4ebc9dc4fd46cdafcc76df644b4896251dac (patch) | |
tree | 69072581bc1249d279dd62f2f2625f29c01b3294 /src/modules/m_spanningtree | |
parent | e8bf6e5fdbcfa2d3c86541eb27e88ab8c1137c07 (diff) |
fix some unitialised vectors and tidy up a bit.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9637 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r-- | src/modules/m_spanningtree/fjoin.cpp | 13 | ||||
-rw-r--r-- | src/modules/m_spanningtree/fmode.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_spanningtree/rconnect.cpp | 3 |
3 files changed, 8 insertions, 11 deletions
diff --git a/src/modules/m_spanningtree/fjoin.cpp b/src/modules/m_spanningtree/fjoin.cpp index 070051a9c..630aab946 100644 --- a/src/modules/m_spanningtree/fjoin.cpp +++ b/src/modules/m_spanningtree/fjoin.cpp @@ -109,16 +109,15 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p if (apply_other_sides_modes) { unsigned int idx = 2; - int numpara = 1; std::vector<std::string> modelist; // Mode parser needs to know what channel to act on. - modelist[0] = params[0]; + modelist.push_back(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]; + modelist.push_back(params[idx]); } this->Instance->SendMode(modelist, this->Instance->FakeClient); @@ -181,13 +180,13 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p { std::deque<std::string> stackresult; std::vector<std::string> mode_junk; - mode_junk[0] = channel; + mode_junk.push_back(channel); while (modestack.GetStackedLine(stackresult)) { for (size_t j = 0; j < stackresult.size(); j++) { - mode_junk[j+1] = stackresult[j]; + mode_junk.push_back(stackresult[j]); } 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; std::vector<std::string> mode_junk; - mode_junk[0] = c->name; + mode_junk.push_back(c->name); for (char modeletter = 'A'; modeletter <= 'z'; ++modeletter) { @@ -227,7 +226,7 @@ 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]; + mode_junk.push_back(stackresult[j]); Instance->SendMode(mode_junk, Instance->FakeClient); } diff --git a/src/modules/m_spanningtree/fmode.cpp b/src/modules/m_spanningtree/fmode.cpp index e7209a852..2ab370170 100644 --- a/src/modules/m_spanningtree/fmode.cpp +++ b/src/modules/m_spanningtree/fmode.cpp @@ -50,7 +50,6 @@ bool TreeSocket::ForceMode(const std::string &source, std::deque<std::string> &p } std::vector<std::string> modelist; time_t TS = 0; - int n = 0; for (unsigned int q = 0; (q < params.size()) && (q < 64); q++) { if (q == 1) @@ -64,7 +63,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]; + modelist.push_back(params[q]); } } diff --git a/src/modules/m_spanningtree/rconnect.cpp b/src/modules/m_spanningtree/rconnect.cpp index 1dce8e7e4..a25226828 100644 --- a/src/modules/m_spanningtree/rconnect.cpp +++ b/src/modules/m_spanningtree/rconnect.cpp @@ -54,8 +54,7 @@ CmdResult cmd_rconnect::Handle (const std::vector<std::string>& parameters, User /* Yes, initiate the given connect */ ServerInstance->SNO->WriteToSnoMask('l',"Remote CONNECT from %s matching \002%s\002, connecting server \002%s\002",user->nick,parameters[0].c_str(),parameters[1].c_str()); std::vector<std::string> para; - para.resize(1); - para[0] = parameters[1]; + para.push_back(parameters[1]); std::string original_command = std::string("CONNECT ") + parameters[1]; Creator->OnPreCommand("CONNECT", para, user, true, original_command); } |