summaryrefslogtreecommitdiff
path: root/src/gui/gui-bar-item.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/gui/gui-bar-item.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/gui/gui-bar-item.c')
-rw-r--r--src/gui/gui-bar-item.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/gui-bar-item.c b/src/gui/gui-bar-item.c
index f9e59b285..33b6e9113 100644
--- a/src/gui/gui-bar-item.c
+++ b/src/gui/gui-bar-item.c
@@ -557,7 +557,7 @@ gui_bar_item_new (struct t_weechat_plugin *plugin, const char *name,
/* add bar item to bar items queue */
new_bar_item->prev_item = last_gui_bar_item;
- if (gui_bar_items)
+ if (last_gui_bar_item)
last_gui_bar_item->next_item = new_bar_item;
else
gui_bar_items = new_bar_item;