X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Fclass.c;h=0bd9397f215c625db75ca6e121786e6824d8682c;hb=456eea6f1896528dad344ed2c254fd07bdc3a4b1;hp=156f943ef9a318269edb487ccef5c6168af11487;hpb=3ab00e3a11acfd22741e58aa409bb2026e0665ba;p=ngircd-alex.git diff --git a/src/ngircd/class.c b/src/ngircd/class.c index 156f943e..0bd9397f 100644 --- a/src/ngircd/class.c +++ b/src/ngircd/class.c @@ -1,6 +1,6 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors. + * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,19 +16,13 @@ * User class management. */ -#include "imp.h" #include +#include #include -#include "defines.h" -#include "array.h" #include "conn.h" -#include "client.h" #include "lists.h" -#include "match.h" -#include "stdio.h" -#include "exp.h" #include "class.h" struct list_head My_Classes[CLASS_COUNT]; @@ -50,11 +44,13 @@ Class_Exit(void) GLOBAL bool Class_GetMemberReason(const int Class, CLIENT *Client, char *reason, size_t len) { - char str[COMMAND_LEN] = "listed"; + char str[COMMAND_LEN]; assert(Class < CLASS_COUNT); assert(Client != NULL); + strlcpy(str, "listed", sizeof(str)); + if (!Lists_CheckReason(&My_Classes[Class], Client, str, sizeof(str))) return false; @@ -104,12 +100,12 @@ Class_AddMask(const int Class, const char *Pattern, time_t ValidUntil, char mask[MASK_LEN]; assert(Class < CLASS_COUNT); - assert(Mask != NULL); + assert(Pattern != NULL); assert(Reason != NULL); Lists_MakeMask(Pattern, mask, sizeof(mask)); return Lists_Add(&My_Classes[Class], mask, - ValidUntil, Reason); + ValidUntil, Reason, false); } GLOBAL void @@ -118,7 +114,7 @@ Class_DeleteMask(const int Class, const char *Pattern) char mask[MASK_LEN]; assert(Class < CLASS_COUNT); - assert(Mask != NULL); + assert(Pattern != NULL); Lists_MakeMask(Pattern, mask, sizeof(mask)); Lists_Del(&My_Classes[Class], mask);