From 525eeb51a52ca9dbd001f0897222f6e5a3dccfb1 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 18 Mar 2008 23:54:33 +0000 Subject: Crash fixes from nenolod git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9126 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_cap.cpp | 9 +++++++-- src/modules/m_namesx.cpp | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') 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") { diff --git a/src/modules/m_namesx.cpp b/src/modules/m_namesx.cpp index a1ae48b70..2e79d6a06 100644 --- a/src/modules/m_namesx.cpp +++ b/src/modules/m_namesx.cpp @@ -129,8 +129,8 @@ class ModuleNamesX : public Module if ((it = std::find(data->wanted.begin(), data->wanted.end(), "multi-prefix")) != data->wanted.end()) { // we can handle this, so ACK it, and remove it from the wanted list - data->wanted.erase(it); data->ack.push_back(*it); + data->wanted.erase(it); data->user->Extend("NAMESX",dummy); } } @@ -146,7 +146,7 @@ class ModuleNamesX : public Module CapData *data = (CapData *) ev->GetData(); if (data->user->GetExt("NAMESX")) - data->ack.push_back("multi-prefix"); + data->wanted.push_back("multi-prefix"); } if (ev->GetEventID() == "cap_clear") -- cgit v1.2.3