]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/lists.c
Lists_MakeMask: Don't destroy source buffer
[ngircd-alex.git] / src / ngircd / lists.c
index d3efb1f7386e746ecbad05979b9b84cf6a92b8ed..022e305eff9a7f61c7b2cd573a5f96fda4b5223d 100644 (file)
@@ -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
  */
 
 #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 "lists.h"
 
@@ -289,6 +285,7 @@ Lists_MakeMask(const char *Pattern, char *mask, size_t len)
                strlcpy(mask, Pattern, len - 5);
                strlcat(mask, "!*@", len);
                strlcat(mask, at, len);
+               at--; *at = '@';
        } else {
                /* All parts (nick, user and domain name) are given */
                strlcpy(mask, Pattern, len);