summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/gui-bar-item.c5
-rw-r--r--src/gui/gui-chat.c2
-rw-r--r--src/gui/gui-completion.c12
-rw-r--r--src/gui/gui-window.c11
-rw-r--r--src/plugins/irc/irc-bar-item.c12
5 files changed, 26 insertions, 16 deletions
diff --git a/src/gui/gui-bar-item.c b/src/gui/gui-bar-item.c
index e323e73c8..4be221727 100644
--- a/src/gui/gui-bar-item.c
+++ b/src/gui/gui-bar-item.c
@@ -296,6 +296,9 @@ gui_bar_item_get_value (const char *name, struct t_gui_bar *bar,
struct t_gui_bar_item *ptr_item;
struct t_weechat_plugin *ptr_plugin;
+ if (!name)
+ return NULL;
+
start = NULL;
end = NULL;
prefix = NULL;
@@ -303,7 +306,7 @@ gui_bar_item_get_value (const char *name, struct t_gui_bar *bar,
suffix = NULL;
ptr = name;
- while (ptr && ptr[0])
+ while (ptr[0])
{
valid_char = gui_bar_item_valid_char_name (ptr[0]);
if (!start && valid_char)
diff --git a/src/gui/gui-chat.c b/src/gui/gui-chat.c
index a14d9255a..c2568271a 100644
--- a/src/gui/gui-chat.c
+++ b/src/gui/gui-chat.c
@@ -581,7 +581,7 @@ gui_chat_printf_date_tags (struct t_gui_buffer *buffer, time_t date,
tags, pos_prefix, ptr_msg);
if (ptr_line)
{
- if (buffer->print_hooks_enabled)
+ if (buffer && buffer->print_hooks_enabled)
hook_print_exec (buffer, ptr_line);
if (ptr_line->data->displayed)
at_least_one_message_printed = 1;
diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c
index a76331f67..7cf125d21 100644
--- a/src/gui/gui-completion.c
+++ b/src/gui/gui-completion.c
@@ -1977,10 +1977,14 @@ gui_completion_complete (struct t_gui_completion *completion)
NULL);
}
- if (completion->direction < 0)
- ptr_item = completion->completion_list->last_item;
- else
- ptr_item = completion->completion_list->items;
+ ptr_item = NULL;
+ if (completion->completion_list)
+ {
+ if (completion->direction < 0)
+ ptr_item = completion->completion_list->last_item;
+ else
+ ptr_item = completion->completion_list->items;
+ }
if (partial_completion
&& completion->word_found
diff --git a/src/gui/gui-window.c b/src/gui/gui-window.c
index 72d1ecc0d..820d3b12a 100644
--- a/src/gui/gui-window.c
+++ b/src/gui/gui-window.c
@@ -598,10 +598,13 @@ gui_window_scroll (struct t_gui_window *window, char *scroll)
ptr_line = ptr_line->next_line;
}
}
-
- old_date = ptr_line->data->date;
- date_tmp = localtime (&old_date);
- memcpy (&old_line_date, date_tmp, sizeof (struct tm));
+
+ if (ptr_line)
+ {
+ old_date = ptr_line->data->date;
+ date_tmp = localtime (&old_date);
+ memcpy (&old_line_date, date_tmp, sizeof (struct tm));
+ }
while (ptr_line)
{
diff --git a/src/plugins/irc/irc-bar-item.c b/src/plugins/irc/irc-bar-item.c
index a2c4047e0..77f07b66a 100644
--- a/src/plugins/irc/irc-bar-item.c
+++ b/src/plugins/irc/irc-bar-item.c
@@ -235,9 +235,9 @@ irc_bar_item_buffer_name (void *data, struct t_gui_bar_item *item,
(part_from_channel) ? IRC_COLOR_BAR_DELIM : "",
(part_from_channel) ? "(" : "",
(server && server->ssl_connected) ? IRC_COLOR_STATUS_NAME_SSL : IRC_COLOR_STATUS_NAME,
- (display_server) ? server->name : "",
- (display_server) ? IRC_COLOR_BAR_DELIM : "",
- (display_server) ? "/" : "",
+ (server && display_server) ? server->name : "",
+ (server && display_server) ? IRC_COLOR_BAR_DELIM : "",
+ (server && display_server) ? "/" : "",
(server && server->ssl_connected) ? IRC_COLOR_STATUS_NAME_SSL : IRC_COLOR_STATUS_NAME,
channel->name,
(part_from_channel) ? IRC_COLOR_BAR_DELIM : "",
@@ -344,9 +344,9 @@ irc_bar_item_channel (void *data, struct t_gui_bar_item *item,
(part_from_channel) ? IRC_COLOR_BAR_DELIM : "",
(part_from_channel) ? "(" : "",
IRC_COLOR_STATUS_NAME,
- (display_server) ? server->name : "",
- (display_server) ? IRC_COLOR_BAR_DELIM : "",
- (display_server) ? "/" : "",
+ (server && display_server) ? server->name : "",
+ (server && display_server) ? IRC_COLOR_BAR_DELIM : "",
+ (server && display_server) ? "/" : "",
IRC_COLOR_STATUS_NAME,
channel->name,
(part_from_channel) ? IRC_COLOR_BAR_DELIM : "",