From 6c725e7a4f39d898024d85b3b93265d3172c5183 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 12 Jan 2006 20:25:51 +0000 Subject: Replaced sprintf's with some char* voodoo git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2781 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/xline.cpp | 73 ++++++++++++++++++++++++++++------------------------------- 1 file changed, 35 insertions(+), 38 deletions(-) (limited to 'src/xline.cpp') diff --git a/src/xline.cpp b/src/xline.cpp index 4a7cfdea5..3437fe0d9 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -55,6 +55,7 @@ extern std::vector modules; extern std::vector factory; extern ServerConfig* Config; extern user_hash clientlist; +extern std::vector local_users; /* Version two, now with optimized expiry! * @@ -654,53 +655,49 @@ void apply_lines(const int What) return; CullList* Goners = new CullList(); - - for (user_hash::const_iterator u = clientlist.begin(); u != clientlist.end(); u++) + for (std::vector::const_iterator u = local_users.begin(); u != local_users.end(); u++) { - if (u->second->fd > -1) + u->MakeHost(host); + if (elines.size()) { - snprintf(host,MAXBUF,"%s@%s",u->second->ident,u->second->host); - if (elines.size()) - { - // ignore people matching exempts - if (matches_exception(host)) - continue; - } - if ((What & APPLY_GLINES) && (glines.size() || pglines.size())) + // ignore people matching exempts + if (matches_exception(host)) + continue; + } + if ((What & APPLY_GLINES) && (glines.size() || pglines.size())) + { + char* check = matches_gline(host); + if (check) { - char* check = matches_gline(host); - if (check) - { - snprintf(reason,MAXBUF,"G-Lined: %s",check); - Goners->AddItem(u->second,reason); - } + snprintf(reason,MAXBUF,"G-Lined: %s",check); + Goners->AddItem(u->second,reason); } - if ((What & APPLY_KLINES) && (klines.size() || pklines.size())) + } + if ((What & APPLY_KLINES) && (klines.size() || pklines.size())) + { + char* check = matches_kline(host); + if (check) { - char* check = matches_kline(host); - if (check) - { - snprintf(reason,MAXBUF,"K-Lined: %s",check); - Goners->AddItem(u->second,reason); - } + snprintf(reason,MAXBUF,"K-Lined: %s",check); + Goners->AddItem(u->second,reason); } - if ((What & APPLY_QLINES) && (qlines.size() || pqlines.size())) + } + if ((What & APPLY_QLINES) && (qlines.size() || pqlines.size())) + { + char* check = matches_qline(u->second->nick); + if (check) { - char* check = matches_qline(u->second->nick); - if (check) - { - snprintf(reason,MAXBUF,"Matched Q-Lined nick: %s",check); - Goners->AddItem(u->second,reason); - } + snprintf(reason,MAXBUF,"Matched Q-Lined nick: %s",check); + Goners->AddItem(u->second,reason); } - if ((What & APPLY_ZLINES) && (zlines.size() || pzlines.size())) + } + if ((What & APPLY_ZLINES) && (zlines.size() || pzlines.size())) + { + char* check = matches_zline(u->second->ip); + if (check) { - char* check = matches_zline(u->second->ip); - if (check) - { - snprintf(reason,MAXBUF,"Z-Lined: %s",check); - Goners->AddItem(u->second,reason); - } + snprintf(reason,MAXBUF,"Z-Lined: %s",check); + Goners->AddItem(u->second,reason); } } } -- cgit v1.2.3