X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fxline.cpp;h=ed3ed6364b1ef01714867cf57e0f64026211c48c;hb=fcacc8e0306382bc3f938073092c3729d77e2b41;hp=b101237a38920295a6aa561d05fce818f947745f;hpb=355b17f151fe8258a025a3db3240339ab7cea445;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/xline.cpp b/src/xline.cpp index b101237a3..ed3ed6364 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -1,16 +1,26 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ +/* + * InspIRCd -- Internet Relay Chat Daemon + * + * Copyright (C) 2009 Daniel De Graaf + * Copyright (C) 2005-2009 Robin Burchell + * Copyright (C) 2004-2008 Craig Edwards + * Copyright (C) 2007 Dennis Friis + * Copyright (C) 2007 John Brooks * - * InspIRCd: (C) 2002-2009 InspIRCd Development Team - * See: http://wiki.inspircd.org/Credits + * This file is part of InspIRCd. InspIRCd is free software: you can + * redistribute it and/or modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation, version 2. * - * This program is free but copyrighted software; see - * the file COPYING for details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * --------------------------------------------------- + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + #include "inspircd.h" #include "xline.h" #include "bancache.h" @@ -146,7 +156,7 @@ void XLineManager::CheckELines() if (ELines.empty()) return; - for (std::vector::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++) + for (std::vector::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++) { User* u = (User*)(*u2); @@ -311,7 +321,7 @@ bool XLineManager::DelLine(const char* hostmask, const std::string &type, User* void ELine::Unset() { /* remove exempt from everyone and force recheck after deleting eline */ - for (std::vector::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++) + for (std::vector::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++) { User* u = (User*)(*u2); u->exempt = false; @@ -415,7 +425,7 @@ void XLineManager::ExpireLine(ContainerIter container, LookupIter item) // applies lines, removing clients and changing nicks etc as applicable void XLineManager::ApplyLines() { - std::vector::reverse_iterator u2 = ServerInstance->Users->local_users.rbegin(); + std::vector::reverse_iterator u2 = ServerInstance->Users->local_users.rbegin(); while (u2 != ServerInstance->Users->local_users.rend()) { User* u = *u2++; @@ -494,7 +504,8 @@ XLineManager::~XLineManager() for(unsigned int i=0; i < sizeof(gekqz); i++) { XLineFactory* xlf = GetFactory(std::string(1, gekqz[i])); - UnregisterFactory(xlf); + if (xlf) + UnregisterFactory(xlf); delete xlf; } @@ -670,7 +681,7 @@ bool GLine::Matches(const std::string &str) void ELine::OnAdd() { /* When adding one eline, only check the one eline */ - for (std::vector::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++) + for (std::vector::const_iterator u2 = ServerInstance->Users->local_users.begin(); u2 != ServerInstance->Users->local_users.end(); u2++) { User* u = (User*)(*u2); if (this->Matches(u))