summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-redirect.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-06-10 16:21:11 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-06-10 16:21:11 +0200
commit54bf589d7da7b714002bf675f20c053426544d6f (patch)
treed0ce6d388ad7cfe9eb9e8b08ff5b589425b97d44 /src/plugins/irc/irc-redirect.c
parent8c8a0c0826ce66c83b08baf9470a2e6a6140b201 (diff)
downloadweechat-54bf589d7da7b714002bf675f20c053426544d6f.zip
core, plugins: fix conditions to insert elements in linked lists
This removes scan-build warnings about dereference of last_xxx null pointers.
Diffstat (limited to 'src/plugins/irc/irc-redirect.c')
-rw-r--r--src/plugins/irc/irc-redirect.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/irc/irc-redirect.c b/src/plugins/irc/irc-redirect.c
index 70f0b3ba2..44648a00d 100644
--- a/src/plugins/irc/irc-redirect.c
+++ b/src/plugins/irc/irc-redirect.c
@@ -325,7 +325,7 @@ irc_redirect_pattern_new (const char *name, int temp_pattern, int timeout,
/* add redirect pattern to end of list */
new_redirect_pattern->prev_redirect = last_irc_redirect_pattern;
- if (irc_redirect_patterns)
+ if (last_irc_redirect_pattern)
last_irc_redirect_pattern->next_redirect = new_redirect_pattern;
else
irc_redirect_patterns = new_redirect_pattern;
@@ -484,7 +484,7 @@ irc_redirect_new_with_commands (struct t_irc_server *server,
/* add redirect to end of list */
new_redirect->prev_redirect = server->last_redirect;
- if (server->redirects)
+ if (server->last_redirect)
(server->last_redirect)->next_redirect = new_redirect;
else
server->redirects = new_redirect;