X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Flists.c;h=563dfa47ba3193bdd30707067d42d1157be35639;hp=9ebd89067fb73f2dfa3a07d28924a65ca0f265e4;hb=3de972e0bdbb5da7b13db5628e5373e3ec57cf51;hpb=3ab00e3a11acfd22741e58aa409bb2026e0665ba diff --git a/src/ngircd/lists.c b/src/ngircd/lists.c index 9ebd8906..563dfa47 100644 --- a/src/ngircd/lists.c +++ b/src/ngircd/lists.c @@ -1,6 +1,6 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001-2011 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,22 +16,16 @@ * Management of IRC lists: ban, invite, etc. */ -#include "imp.h" #include +#include +#include +#include +#include -#include "defines.h" #include "conn.h" -#include "channel.h" #include "log.h" #include "match.h" -#include "messages.h" -#include "irc-write.h" - -#include -#include -#include -#include "exp.h" #include "lists.h" struct list_elem { @@ -279,16 +273,16 @@ Lists_MakeMask(const char *Pattern, char *mask, size_t len) if (!at && !excl) { /* Neither "!" nor "@" found: use string as nickname */ - strlcpy(mask, Pattern, len); + strlcpy(mask, Pattern, len - 5); strlcat(mask, "!*@*", len); } else if (!at && excl) { /* Domain part is missing */ - strlcpy(mask, Pattern, len); + strlcpy(mask, Pattern, len - 3); strlcat(mask, "@*", len); } else if (at && !excl) { /* User name is missing */ *at = '\0'; at++; - strlcpy(mask, Pattern, len); + strlcpy(mask, Pattern, len - 5); strlcat(mask, "!*@", len); strlcat(mask, at, len); } else { @@ -311,13 +305,12 @@ Lists_Check(struct list_head *h, CLIENT *Client) } /** - * Check if a client is listed in a list and store the reason if a buffer - * is provided. + * Check if a client is listed in a list and store the reason. * * @param h List head. * @param Client Client to check. - * @param reason Result buffer to store the reason. - * @param len Size of the buffer. + * @param reason Buffer to store the reason. + * @param len Size of the buffer if reason should be saved. * @return true if client is listed, false if not. */ bool