From 416cc382022d9c41670e7b53390a900ef0ec8c89 Mon Sep 17 00:00:00 2001 From: om Date: Sat, 4 Feb 2006 11:07:58 +0000 Subject: Stop trying to set an empty swhois if the doesn't specify one git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3071 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_swhois.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index a8142030d..000eeb040 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -187,16 +187,19 @@ class ModuleSWhois : public Module { std::string swhois = Conf->ReadValue("type", "swhois", i); - if(std::string* old = (std::string*)user->GetExt("swhois")) + if(swhois.length()) { - user->Shrink("swhois"); - delete old; - } + if(std::string* old = (std::string*)user->GetExt("swhois")) + { + user->Shrink("swhois"); + delete old; + } - std::string* text = new std::string(swhois); - user->Extend("swhois", (char*)text); - - break; + std::string* text = new std::string(swhois); + user->Extend("swhois", (char*)text); + + break; + } } } } -- cgit v1.2.3