summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2013-12-08 08:31:44 +0100
committerSebastien Helleu <flashcode@flashtux.org>2013-12-08 08:31:44 +0100
commit0b27dd58b3c0cd26927184cd0a3ff120dd7f457d (patch)
treee0d92c2bc05967af290dec85e26f124d59beacac /src
parentc832116caeb2d001bc9c765a59c1053e3ad1cc9d (diff)
downloadweechat-0b27dd58b3c0cd26927184cd0a3ff120dd7f457d.zip
irc: don't return a default ban mask if option is not set or if host is not found
Diffstat (limited to 'src')
-rw-r--r--src/plugins/irc/irc-nick.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/plugins/irc/irc-nick.c b/src/plugins/irc/irc-nick.c
index 38adf52fb..e1842cbf4 100644
--- a/src/plugins/irc/irc-nick.c
+++ b/src/plugins/irc/irc-nick.c
@@ -1054,9 +1054,8 @@ irc_nick_color_for_pv (struct t_irc_channel *channel, const char *nickname)
char *
irc_nick_default_ban_mask (struct t_irc_nick *nick)
{
- static char ban_mask[128];
const char *ptr_ban_mask;
- char *pos_hostname, user[64], *res, *temp;
+ char *pos_hostname, user[128], *res, *temp;
if (!nick)
return NULL;
@@ -1066,10 +1065,7 @@ irc_nick_default_ban_mask (struct t_irc_nick *nick)
pos_hostname = (nick->host) ? strchr (nick->host, '@') : NULL;
if (!nick->host || !pos_hostname || !ptr_ban_mask || !ptr_ban_mask[0])
- {
- snprintf (ban_mask, sizeof (ban_mask), "%s!*@*", nick->name);
- return strdup (ban_mask);
- }
+ return NULL;
if (pos_hostname - nick->host > (int)sizeof (user) - 1)
return NULL;