From 729e71cad44944f78c9d80bc7c2a93e305543269 Mon Sep 17 00:00:00 2001 From: peavey Date: Fri, 15 Jun 2007 10:15:18 +0000 Subject: And truly fix rsquit 1 parm crash. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7331 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/rsquit.cpp | 37 +++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_spanningtree/rsquit.cpp b/src/modules/m_spanningtree/rsquit.cpp index 86ba4d306..73b31d511 100644 --- a/src/modules/m_spanningtree/rsquit.cpp +++ b/src/modules/m_spanningtree/rsquit.cpp @@ -61,13 +61,13 @@ CmdResult cmd_rsquit::Handle (const char** parameters, int pcnt, userrec *user) { if (ServerInstance->MatchText(ServerInstance->Config->ServerName,parameters[0])) { - if (s == Utils->TreeRoot) - { - NoticeUser(user, "*** RSQUIT: Foolish mortal, you cannot make a server SQUIT itself! ("+ConvToStr(parameters[1])+" matches local server name)"); - return CMD_FAILURE; - } if (s) { + if (s == Utils->TreeRoot) + { + NoticeUser(user, "*** RSQUIT: Foolish mortal, you cannot make a server SQUIT itself! ("+ConvToStr(parameters[1])+" matches local server name)"); + return CMD_FAILURE; + } TreeSocket* sock = s->GetSocket(); if (!sock) { @@ -84,19 +84,22 @@ CmdResult cmd_rsquit::Handle (const char** parameters, int pcnt, userrec *user) } else { - if (s == Utils->TreeRoot) - { - NoticeUser(user, "*** RSQUIT: Foolish mortal, you cannot make a server SQUIT itself! ("+ConvToStr(parameters[0])+" matches local server name)"); - return CMD_FAILURE; - } - TreeSocket* sock = s->GetSocket(); - if (sock) + if (s) { - ServerInstance->SNO->WriteToSnoMask('l',"RSQUIT: Server \002%s\002 removed from network by %s",parameters[0],user->nick); - sock->Squit(s,std::string("Server quit by ") + user->GetFullRealHost()); - ServerInstance->SE->DelFd(sock); - sock->Close(); - delete sock; + if (s == Utils->TreeRoot) + { + NoticeUser(user, "*** RSQUIT: Foolish mortal, you cannot make a server SQUIT itself! ("+ConvToStr(parameters[0])+" matches local server name)"); + return CMD_FAILURE; + } + TreeSocket* sock = s->GetSocket(); + if (sock) + { + ServerInstance->SNO->WriteToSnoMask('l',"RSQUIT: Server \002%s\002 removed from network by %s",parameters[0],user->nick); + sock->Squit(s,std::string("Server quit by ") + user->GetFullRealHost()); + ServerInstance->SE->DelFd(sock); + sock->Close(); + delete sock; + } } } -- cgit v1.2.3