summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/hashcomp.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp
index d0a4ab104..8a4febb60 100644
--- a/src/hashcomp.cpp
+++ b/src/hashcomp.cpp
@@ -321,12 +321,12 @@ void irc::modestacker::Push(char modeletter, const std::string &parameter)
sequence.push_back(parameter);
}
-std::deque<std::string> irc::modestacker::GetStackedLine()
+int irc::modestacker::GetStackedLine(std::deque<std::string> &result)
{
- std::deque<std::string> result;
- result.push_back("");
+ result.clear();
+ result.push_back(adding ? "+" : "-");
- while (!sequence[0].empty() && (sequence.size() > 1))
+ while (!sequence[0].empty() && (sequence.size() > 1) && (result.size() < MAXMODES+1))
{
result[0] += *(sequence[0].begin());
result.push_back(sequence[1]);
@@ -334,6 +334,6 @@ std::deque<std::string> irc::modestacker::GetStackedLine()
sequence.erase(sequence.begin() + 1);
}
- return result;
+ return result.size();
}