mirror of
https://github.com/irssi/irssi.git
synced 2024-09-01 04:14:16 -04:00
Let ignore_check do its work when server is NULL
A NULL-check has been added to the ignore_match_server macro, making the function safe from a pointer perspective. Fixes #193 in the meanwhile.
This commit is contained in:
parent
fbb838b3b0
commit
8701cbc972
@ -97,8 +97,8 @@ static int ignore_match_pattern(IGNORE_REC *rec, const char *text)
|
|||||||
match_wildcards((rec)->mask, nick)))
|
match_wildcards((rec)->mask, nick)))
|
||||||
|
|
||||||
#define ignore_match_server(rec, server) \
|
#define ignore_match_server(rec, server) \
|
||||||
((rec)->servertag == NULL || \
|
((rec)->servertag == NULL || ((server) != NULL && \
|
||||||
g_ascii_strcasecmp((server)->tag, (rec)->servertag) == 0)
|
g_ascii_strcasecmp((server)->tag, (rec)->servertag) == 0))
|
||||||
|
|
||||||
#define ignore_match_channel(rec, channel) \
|
#define ignore_match_channel(rec, channel) \
|
||||||
((rec)->channels == NULL || ((channel) != NULL && \
|
((rec)->channels == NULL || ((channel) != NULL && \
|
||||||
@ -135,7 +135,6 @@ int ignore_check(SERVER_REC *server, const char *nick, const char *host,
|
|||||||
char *nickmask;
|
char *nickmask;
|
||||||
int len, best_mask, best_match, best_patt;
|
int len, best_mask, best_match, best_patt;
|
||||||
|
|
||||||
g_return_val_if_fail(server != NULL, 0);
|
|
||||||
if (nick == NULL) nick = "";
|
if (nick == NULL) nick = "";
|
||||||
|
|
||||||
chanrec = server == NULL || channel == NULL ? NULL :
|
chanrec = server == NULL || channel == NULL ? NULL :
|
||||||
|
Loading…
Reference in New Issue
Block a user