1
0
mirror of https://github.com/irssi/irssi.git synced 2025-01-03 14:56:47 -05:00

Prevent some potential null-pointer deferences.

Spotted by our friend scan-build.
This commit is contained in:
LemonBoy 2017-02-14 13:38:59 +01:00
parent 228f487a69
commit 98ead50b4e
3 changed files with 5 additions and 1 deletions

View File

@ -453,7 +453,7 @@ static void display_sorted_nicks(CHANNEL_REC *channel, GSList *nicklist)
}
}
if (str->len > strlen(prefix_format)) {
if (prefix_format != NULL && str->len > strlen(prefix_format)) {
printtext(channel->server, channel->visible_name,
MSGLEVEL_CLIENTCRAP, "%s", str->str);
}

View File

@ -148,6 +148,8 @@ static void print_server_splits(IRC_SERVER_REC *server, TEMP_SPLIT_REC *rec, con
char *sourceserver;
GSList *tmp;
g_return_if_fail(rec->servers != NULL);
destservers = g_string_new(NULL);
for (tmp = rec->servers; tmp != NULL; tmp = tmp->next) {
NETSPLIT_SERVER_REC *rec = tmp->data;

View File

@ -121,6 +121,8 @@ static void sig_layout_restore(void)
if (node == NULL) return;
sorted_config = get_sorted_windows_config(node);
if (sorted_config == NULL) return;
windows_count = g_slist_length(sorted_config);
/* calculate the saved terminal height */