From 77663a52c6147637fcdd2a6bf1797840daa8bff5 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 28 Aug 2006 17:39:25 +0000 Subject: Hint of the day: When you have a function that can return a bool, dont mix up the true and false returns. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5050 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_chanprotect.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index 2951e711b..5a6e4853d 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -86,12 +86,12 @@ class FounderProtectBase if ((!theuser) || (!channel->HasUser(theuser))) { parameter = ""; - return theuser; + return NULL; } - return NULL; + return theuser; } - ModeAction HandleChange(userrec* source, userrec*theuser, bool adding, chanrec* channel, std::string ¶meter) + ModeAction HandleChange(userrec* source, userrec* theuser, bool adding, chanrec* channel, std::string ¶meter) { std::string item = extend+std::string(channel->name); @@ -140,7 +140,9 @@ class ChanFounder : public ModeHandler, public FounderProtectBase userrec* theuser = FounderProtectBase::FindAndVerify(parameter, channel); if (!theuser) + { return MODEACTION_DENY; + } // source is a server, or ulined, we'll let them +-q the user. if ((ServerInstance->ULine(source->nick)) || (ServerInstance->ULine(source->server)) || (!*source->server) || (!IS_LOCAL(source))) -- cgit v1.2.3