]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/lists.c
Update #include's: remove unused and add missing ones
[ngircd-alex.git] / src / ngircd / lists.c
index 9ebd89067fb73f2dfa3a07d28924a65ca0f265e4..ab2aeb3c32069fec47fa101d44660749db22ba27 100644 (file)
  * Management of IRC lists: ban, invite, etc.
  */
 
-#include "imp.h"
 #include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
+#include <time.h>
 
-#include "defines.h"
 #include "conn.h"
-#include "channel.h"
 #include "log.h"
 #include "match.h"
-#include "messages.h"
-#include "irc-write.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <strings.h>
 
-#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