summaryrefslogtreecommitdiff
path: root/src/modules/m_cap.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-18 23:54:33 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-18 23:54:33 +0000
commit525eeb51a52ca9dbd001f0897222f6e5a3dccfb1 (patch)
tree971f1c206b59b12baa41d1cf476ecf385aa98e57 /src/modules/m_cap.cpp
parent9a2481ebf1109adc4b626414108d92674793cd5d (diff)
Crash fixes from nenolod
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9126 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_cap.cpp')
-rw-r--r--src/modules/m_cap.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/modules/m_cap.cpp b/src/modules/m_cap.cpp
index 5673c7f62..86f79103c 100644
--- a/src/modules/m_cap.cpp
+++ b/src/modules/m_cap.cpp
@@ -98,8 +98,13 @@ class CommandCAP : public Command
Event event((char*) &Data, (Module*)this->Creator, subcommand == "LS" ? "cap_ls" : "cap_list");
event.Send(this->ServerInstance);
- std::string Result = irc::stringjoiner(" ", Data.wanted, 0, Data.wanted.size() - 1).GetJoined();
- user->WriteServ("CAP * LS :%s", Result.c_str());
+ std::string Result;
+ if (Data.wanted.size() > 0)
+ Result = irc::stringjoiner(" ", Data.wanted, 0, Data.wanted.size() - 1).GetJoined();
+ else
+ Result = "";
+
+ user->WriteServ("CAP * %s :%s", subcommand.c_str(), Result.c_str());
}
else if (subcommand == "CLEAR")
{