From 82a425d22656cabda9f1e9e91a504db805a5c4a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Thu, 5 Sep 2024 20:53:54 +0200 Subject: [PATCH] core, plugins: add missing parentheses when dereferencing a pointer with an array index --- src/core/core-command.c | 4 +-- src/core/core-infolist.c | 2 +- src/gui/curses/gui-curses-color.c | 6 ++-- src/gui/gui-bar-item.c | 2 +- src/gui/gui-bar-window.c | 2 +- src/gui/gui-buffer.c | 2 +- src/gui/gui-chat.c | 2 +- src/gui/gui-key.c | 4 +-- src/plugins/buflist/buflist-bar-item.c | 4 +-- src/plugins/guile/weechat-guile.c | 2 +- src/plugins/irc/irc-batch.c | 2 +- src/plugins/irc/irc-command.c | 10 +++--- src/plugins/irc/irc-ctcp.c | 2 +- src/plugins/irc/irc-join.c | 6 ++-- src/plugins/irc/irc-message.c | 2 +- src/plugins/irc/irc-protocol.c | 34 +++++++++---------- src/plugins/irc/irc-server.c | 12 +++---- src/plugins/irc/irc-tag.c | 2 +- src/plugins/lua/weechat-lua.c | 2 +- src/plugins/perl/weechat-perl.c | 2 +- src/plugins/python/weechat-python.c | 2 +- .../relay/api/remote/relay-remote-event.c | 6 ++-- src/plugins/ruby/weechat-ruby.c | 2 +- src/plugins/script/script-action.c | 6 ++-- src/plugins/typing/typing-bar-item.c | 2 +- 25 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/core/core-command.c b/src/core/core-command.c index 0c47f7aeb..c7a4e5c52 100644 --- a/src/core/core-command.c +++ b/src/core/core-command.c @@ -5059,7 +5059,7 @@ command_plugin_list_input (struct t_gui_buffer *buffer, for (ptr_item = list->items; ptr_item; ptr_item = ptr_item->next_item) { - if (*buf[0]) + if ((*buf)[0]) { string_dyn_concat (buf, ", ", -1); } @@ -5074,7 +5074,7 @@ command_plugin_list_input (struct t_gui_buffer *buffer, string_dyn_concat (buf, ptr_item->data, -1); } - if (!*buf[0]) + if (!(*buf)[0]) { string_dyn_concat ( buf, diff --git a/src/core/core-infolist.c b/src/core/core-infolist.c index eaf62923e..c851bfa1e 100644 --- a/src/core/core-infolist.c +++ b/src/core/core-infolist.c @@ -410,7 +410,7 @@ infolist_fields (struct t_infolist *infolist) for (ptr_var = infolist->ptr_item->vars; ptr_var; ptr_var = ptr_var->next_var) { - if (*fields[0]) + if ((*fields)[0]) string_dyn_concat (fields, ",", -1); string_dyn_concat (fields, infolist_type_char_string[ptr_var->type], -1); string_dyn_concat (fields, ":", -1); diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c index f851d623b..40c8b57f8 100644 --- a/src/gui/curses/gui-curses-color.c +++ b/src/gui/curses/gui-curses-color.c @@ -369,10 +369,10 @@ gui_color_get_pairs_arrays (short **foregrounds, short **backgrounds) *foregrounds = NULL; *backgrounds = NULL; - *foregrounds = malloc (sizeof (*foregrounds[0]) * (gui_color_num_pairs + 1)); + *foregrounds = malloc (sizeof ((*foregrounds)[0]) * (gui_color_num_pairs + 1)); if (!*foregrounds) goto error; - *backgrounds = malloc (sizeof (*backgrounds[0]) * (gui_color_num_pairs + 1)); + *backgrounds = malloc (sizeof ((*backgrounds)[0]) * (gui_color_num_pairs + 1)); if (!*backgrounds) goto error; @@ -609,7 +609,7 @@ gui_color_build (int number, int foreground, int background) /* allocate color */ if (!gui_color[number]) { - gui_color[number] = malloc (sizeof (*gui_color[number])); + gui_color[number] = malloc (sizeof ((*gui_color)[number])); if (!gui_color[number]) return; } diff --git a/src/gui/gui-bar-item.c b/src/gui/gui-bar-item.c index 74505398e..e2d81f14c 100644 --- a/src/gui/gui-bar-item.c +++ b/src/gui/gui-bar-item.c @@ -1874,7 +1874,7 @@ gui_bar_item_buffer_nicklist_cb (const void *pointer, void *data, && buffer->nicklist_display_groups && ptr_group->visible)) { - if (*nicklist[0]) + if ((*nicklist)[0]) string_dyn_concat (nicklist, "\n", -1); if (ptr_nick) diff --git a/src/gui/gui-bar-window.c b/src/gui/gui-bar-window.c index 89196ee21..c397ccc39 100644 --- a/src/gui/gui-bar-window.c +++ b/src/gui/gui-bar-window.c @@ -976,7 +976,7 @@ gui_bar_window_content_get_with_filling (struct t_gui_bar_window *bar_window, break; } - if (!*content[0]) + if (!(*content)[0]) { string_dyn_free (content, 1); return NULL; diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index d473bb748..bb8ef4596 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -1940,7 +1940,7 @@ gui_buffer_set_highlight_words_list (struct t_gui_buffer *buffer, ptr_string = weelist_string (ptr_list_item); if (ptr_string) { - if (*words[0]) + if ((*words)[0]) string_dyn_concat (words, ",", -1); string_dyn_concat (words, ptr_string, -1); } diff --git a/src/gui/gui-chat.c b/src/gui/gui-chat.c index 7a39c69b9..0eb2a1ac8 100644 --- a/src/gui/gui-chat.c +++ b/src/gui/gui-chat.c @@ -814,7 +814,7 @@ gui_chat_add_line_waiting_buffer (const char *message) return; } - if (*gui_chat_lines_waiting_buffer[0]) + if ((*gui_chat_lines_waiting_buffer)[0]) string_dyn_concat (gui_chat_lines_waiting_buffer, "\n", -1); string_dyn_concat (gui_chat_lines_waiting_buffer, message, -1); diff --git a/src/gui/gui-key.c b/src/gui/gui-key.c index 0b4d3353a..1ebe01449 100644 --- a/src/gui/gui-key.c +++ b/src/gui/gui-key.c @@ -436,10 +436,10 @@ gui_key_expand (const char *key, char **key_name, char **key_name_alias) meta2 = 0; shift = 0; - if (*str_dyn_key[0]) + if ((*str_dyn_key)[0]) string_dyn_concat (str_dyn_key, ",", -1); - if (*str_dyn_key_alias[0]) + if ((*str_dyn_key_alias)[0]) string_dyn_concat (str_dyn_key_alias, ",", -1); str_raw[0] = '\0'; diff --git a/src/plugins/buflist/buflist-bar-item.c b/src/plugins/buflist/buflist-bar-item.c index dcfa55503..7a92ce04d 100644 --- a/src/plugins/buflist/buflist-bar-item.c +++ b/src/plugins/buflist/buflist-bar-item.c @@ -568,7 +568,7 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data, str_hotlist_count); if (count > 0) { - if (*hotlist[0]) + if ((*hotlist)[0]) { weechat_string_dyn_concat ( hotlist, @@ -644,7 +644,7 @@ buflist_bar_item_buflist_cb (const void *pointer, void *data, /* add newline between each buffer (if needed) */ if (weechat_config_boolean (buflist_config_look_add_newline) - && *buflist[0]) + && (*buflist)[0]) { if (!weechat_string_dyn_concat (buflist, "\n", -1)) goto error; diff --git a/src/plugins/guile/weechat-guile.c b/src/plugins/guile/weechat-guile.c index ce494bba4..cc0d86aea 100644 --- a/src/plugins/guile/weechat-guile.c +++ b/src/plugins/guile/weechat-guile.c @@ -122,7 +122,7 @@ weechat_guile_output_flush () char *temp_buffer, *command; int length; - if (!*guile_buffer_output[0]) + if (!(*guile_buffer_output)[0]) return; /* if there's no buffer, we catch the output, so there's no flush */ diff --git a/src/plugins/irc/irc-batch.c b/src/plugins/irc/irc-batch.c index a91fa79e4..020ed86cd 100644 --- a/src/plugins/irc/irc-batch.c +++ b/src/plugins/irc/irc-batch.c @@ -418,7 +418,7 @@ irc_batch_process_multiline (struct t_irc_server *server, if (tags && tags[0]) irc_tag_parse (tags, hash_tags, NULL); } - if (*result[0]) + if ((*result)[0]) { if (!hash_tags || !weechat_hashtable_has_key (hash_tags, diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 13869a897..e9d1db0f5 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -265,7 +265,7 @@ irc_command_mode_masks_convert_ranges (char **argv, int arg_start) { for (j = number1; j <= number2; j++) { - if (*str_masks[0]) + if ((*str_masks)[0]) weechat_string_dyn_concat (str_masks, " ", -1); snprintf (str_number, sizeof (str_number), "%ld", j); @@ -278,7 +278,7 @@ irc_command_mode_masks_convert_ranges (char **argv, int arg_start) if (!added) { - if (*str_masks[0]) + if ((*str_masks)[0]) weechat_string_dyn_concat (str_masks, " ", -1); weechat_string_dyn_concat (str_masks, argv[i], -1); } @@ -392,7 +392,7 @@ irc_command_mode_masks (struct t_irc_server *server, * if we reached the max number of modes allowed, send the MODE * command now and flush the modes/masks strings */ - if (*modes[0] && (modes_added == max_modes)) + if ((*modes)[0] && (modes_added == max_modes)) { irc_server_sendf (server, msg_priority, NULL, "MODE %s %s%s %s", @@ -408,7 +408,7 @@ irc_command_mode_masks (struct t_irc_server *server, /* add one mode letter (after +/-) and add the mask in masks */ weechat_string_dyn_concat (modes, mode, -1); - if (*masks[0]) + if ((*masks)[0]) weechat_string_dyn_concat (masks, " ", -1); weechat_string_dyn_concat (masks, (mask) ? mask : argv[pos_masks], -1); modes_added++; @@ -417,7 +417,7 @@ irc_command_mode_masks (struct t_irc_server *server, } /* send a final MODE command if some masks are remaining */ - if (*modes[0] && *masks[0]) + if ((*modes)[0] && (*masks)[0]) { irc_server_sendf (server, msg_priority, NULL, "MODE %s %s%s %s", diff --git a/src/plugins/irc/irc-ctcp.c b/src/plugins/irc/irc-ctcp.c index a34f28c57..1165732f5 100644 --- a/src/plugins/irc/irc-ctcp.c +++ b/src/plugins/irc/irc-ctcp.c @@ -602,7 +602,7 @@ irc_ctcp_get_supported_ctcp (struct t_irc_server *server) (const char *)weechat_arraylist_get (list_ctcp, i)); if (ctcp_upper) { - if (*result[0]) + if ((*result)[0]) weechat_string_dyn_concat (result, " ", -1); weechat_string_dyn_concat (result, ctcp_upper, -1); free (ctcp_upper); diff --git a/src/plugins/irc/irc-join.c b/src/plugins/irc/irc-join.c index 81ac96863..9fed8e39b 100644 --- a/src/plugins/irc/irc-join.c +++ b/src/plugins/irc/irc-join.c @@ -413,18 +413,18 @@ irc_join_build_string (struct t_arraylist *arraylist) { ptr_join_chan = (struct t_irc_join_channel *)weechat_arraylist_get ( arraylist, i); - if (*channels[0]) + if ((*channels)[0]) weechat_string_dyn_concat (channels, ",", -1); weechat_string_dyn_concat (channels, ptr_join_chan->name, -1); if (ptr_join_chan->key) { - if (*keys[0]) + if ((*keys)[0]) weechat_string_dyn_concat (keys, ",", -1); weechat_string_dyn_concat (keys, ptr_join_chan->key, -1); } } - if (*keys[0]) + if ((*keys)[0]) { weechat_string_dyn_concat (channels, " ", -1); weechat_string_dyn_concat (channels, *keys, -1); diff --git a/src/plugins/irc/irc-message.c b/src/plugins/irc/irc-message.c index 052b07282..e20e0e0c1 100644 --- a/src/plugins/irc/irc-message.c +++ b/src/plugins/irc/irc-message.c @@ -82,7 +82,7 @@ irc_message_parse_params (const char *parameters, *params = malloc ((alloc_params + 1) * sizeof ((*params)[0])); if (!*params) return; - *params[0] = NULL; + (*params)[0] = NULL; } ptr_params = parameters; diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index a08190209..830f6fefe 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -181,7 +181,7 @@ irc_protocol_tags_add_cb (void *data, str_tags = (char **)data; - if (*str_tags[0]) + if ((*str_tags)[0]) weechat_string_dyn_concat (str_tags, ",", -1); weechat_string_dyn_concat (str_tags, "irc_tag_", -1); @@ -274,7 +274,7 @@ irc_protocol_tags (struct t_irc_protocol_ctxt *ctxt, const char *extra_tags) ptr_batch = irc_batch_search (ctxt->server, ptr_tag_batch); if (ptr_batch) { - if (*str_irc_tags[0]) + if ((*str_irc_tags)[0]) weechat_string_dyn_concat (str_irc_tags, ",", -1); weechat_string_dyn_concat (str_irc_tags, "irc_batch_type_", -1); @@ -301,8 +301,8 @@ irc_protocol_tags (struct t_irc_protocol_ctxt *ctxt, const char *extra_tags) (ctxt->command && ctxt->command[0]) ? ctxt->command : "", (is_numeric) ? "," : "", (is_numeric) ? "irc_numeric" : "", - (str_irc_tags && *str_irc_tags[0]) ? "," : "", - (str_irc_tags && *str_irc_tags[0]) ? *str_irc_tags : "", + (str_irc_tags && (*str_irc_tags)[0]) ? "," : "", + (str_irc_tags && (*str_irc_tags)[0]) ? *str_irc_tags : "", (extra_tags && extra_tags[0]) ? "," : "", (extra_tags && extra_tags[0]) ? extra_tags : "", (ctxt->ignore_tag) ? ",irc_ignored" : "", @@ -717,7 +717,7 @@ irc_protocol_cap_print_cb (void *data, str_caps = (char **)data; - if (*str_caps[0]) + if ((*str_caps)[0]) weechat_string_dyn_concat (str_caps, " ", -1); weechat_string_dyn_concat (str_caps, key, -1); if (value) @@ -767,7 +767,7 @@ irc_protocol_cap_to_enable (const char *capabilities, int sasl_requested) ","); if (supported_caps) { - if (*str_caps[0]) + if ((*str_caps)[0]) weechat_string_dyn_concat (str_caps, ",", -1); weechat_string_dyn_concat (str_caps, supported_caps, -1); free (supported_caps); @@ -775,7 +775,7 @@ irc_protocol_cap_to_enable (const char *capabilities, int sasl_requested) } else { - if (*str_caps[0]) + if ((*str_caps)[0]) weechat_string_dyn_concat (str_caps, ",", -1); weechat_string_dyn_concat (str_caps, caps[i], -1); } @@ -786,7 +786,7 @@ irc_protocol_cap_to_enable (const char *capabilities, int sasl_requested) if (sasl_requested) { - if (*str_caps[0]) + if ((*str_caps)[0]) weechat_string_dyn_concat (str_caps, ",", -1); weechat_string_dyn_concat (str_caps, "sasl", -1); } @@ -897,7 +897,7 @@ irc_protocol_cap_sync (struct t_irc_server *server, int sasl) { if (sasl && strcmp (caps_server[i], "sasl") == 0) sasl_to_do = 1; - if (*cap_req[0]) + if ((*cap_req)[0]) weechat_string_dyn_concat (cap_req, " ", -1); weechat_string_dyn_concat (cap_req, caps_server[i], -1); } @@ -1165,7 +1165,7 @@ IRC_PROTOCOL_CALLBACK(cap) { if (caps_supported[j][0] == '-') { - if (*str_caps_disabled[0]) + if ((*str_caps_disabled)[0]) weechat_string_dyn_concat (str_caps_disabled, " ", -1); weechat_string_dyn_concat (str_caps_disabled, caps_supported[j] + 1, @@ -1177,7 +1177,7 @@ IRC_PROTOCOL_CALLBACK(cap) } else { - if (*str_caps_enabled[0]) + if ((*str_caps_enabled)[0]) weechat_string_dyn_concat (str_caps_enabled, " ", -1); weechat_string_dyn_concat (str_caps_enabled, caps_supported[j], @@ -1192,7 +1192,7 @@ IRC_PROTOCOL_CALLBACK(cap) } weechat_string_free_split (caps_supported); } - if (*str_caps_enabled[0] && *str_caps_disabled[0]) + if ((*str_caps_enabled)[0] && (*str_caps_disabled)[0]) { weechat_printf_datetime_tags ( ctxt->server->buffer, @@ -1203,7 +1203,7 @@ IRC_PROTOCOL_CALLBACK(cap) weechat_prefix ("network"), IRC_PLUGIN_NAME, *str_caps_enabled, *str_caps_disabled); } - else if (*str_caps_enabled[0]) + else if ((*str_caps_enabled)[0]) { weechat_printf_datetime_tags ( ctxt->server->buffer, @@ -1214,7 +1214,7 @@ IRC_PROTOCOL_CALLBACK(cap) weechat_prefix ("network"), IRC_PLUGIN_NAME, *str_caps_enabled); } - else if (*str_caps_disabled[0]) + else if ((*str_caps_disabled)[0]) { weechat_printf_datetime_tags ( ctxt->server->buffer, @@ -6208,7 +6208,7 @@ IRC_PROTOCOL_CALLBACK(353) } else if (!ptr_channel && str_nicks) { - if (*str_nicks[0]) + if ((*str_nicks)[0]) { weechat_string_dyn_concat (str_nicks, IRC_COLOR_RESET, -1); weechat_string_dyn_concat (str_nicks, " ", -1); @@ -6473,7 +6473,7 @@ irc_protocol_get_string_channel_nicks (struct t_irc_server *server, if (!filter_ok) continue; - if (*str_nicks[0]) + if ((*str_nicks)[0]) { weechat_string_dyn_concat (str_nicks, IRC_COLOR_RESET, @@ -6608,7 +6608,7 @@ irc_protocol_get_string_channel_nicks_count (struct t_irc_server *server, snprintf (str_mode_name, sizeof (str_mode_name), "+%c", ptr_prefix_modes[i]); } - if (*str_counts[0]) + if ((*str_counts)[0]) weechat_string_dyn_concat (str_counts, ", ", -1); weechat_string_dyn_concat (str_counts, str_count, -1); weechat_string_dyn_concat (str_counts, str_mode_name, -1); diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index 64acc0538..2c0ad3f21 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -6067,19 +6067,19 @@ irc_server_build_autojoin (struct t_irc_server *server) if (ptr_channel->key) { /* add channel with key and the key */ - if (*channels_with_key[0]) + if ((*channels_with_key)[0]) weechat_string_dyn_concat (channels_with_key, ",", -1); weechat_string_dyn_concat (channels_with_key, ptr_channel->name, -1); - if (*keys[0]) + if ((*keys)[0]) weechat_string_dyn_concat (keys, ",", -1); weechat_string_dyn_concat (keys, ptr_channel->key, -1); } else { /* add channel without key */ - if (*channels_others[0]) + if ((*channels_others)[0]) weechat_string_dyn_concat (channels_others, ",", -1); weechat_string_dyn_concat (channels_others, ptr_channel->name, @@ -6096,13 +6096,13 @@ irc_server_build_autojoin (struct t_irc_server *server) * concatenate channels_with_key + channels_others + keys * into channels_with_key */ - if (*channels_others[0]) + if ((*channels_others)[0]) { - if (*channels_with_key[0]) + if ((*channels_with_key)[0]) weechat_string_dyn_concat (channels_with_key, ",", -1); weechat_string_dyn_concat (channels_with_key, *channels_others, -1); } - if (*keys[0]) + if ((*keys)[0]) { weechat_string_dyn_concat (channels_with_key, " ", -1); weechat_string_dyn_concat (channels_with_key, *keys, -1); diff --git a/src/plugins/irc/irc-tag.c b/src/plugins/irc/irc-tag.c index 45851d330..0e4bd2a30 100644 --- a/src/plugins/irc/irc-tag.c +++ b/src/plugins/irc/irc-tag.c @@ -301,7 +301,7 @@ irc_tag_add_to_string_cb (void *data, string = (char **)data; - if (*string[0]) + if ((*string)[0]) weechat_string_dyn_concat (string, ";", -1); weechat_string_dyn_concat (string, key, -1); diff --git a/src/plugins/lua/weechat-lua.c b/src/plugins/lua/weechat-lua.c index c73b6656f..c30454fcc 100644 --- a/src/plugins/lua/weechat-lua.c +++ b/src/plugins/lua/weechat-lua.c @@ -192,7 +192,7 @@ weechat_lua_output_flush () char *temp_buffer, *command; int length; - if (!*lua_buffer_output[0]) + if (!(*lua_buffer_output)[0]) return; /* if there's no buffer, we catch the output, so there's no flush */ diff --git a/src/plugins/perl/weechat-perl.c b/src/plugins/perl/weechat-perl.c index d0b79f701..c050f4c77 100644 --- a/src/plugins/perl/weechat-perl.c +++ b/src/plugins/perl/weechat-perl.c @@ -229,7 +229,7 @@ weechat_perl_output_flush () char *temp_buffer, *command; int length; - if (!*perl_buffer_output[0]) + if (!(*perl_buffer_output)[0]) return; /* if there's no buffer, we catch the output, so there's no flush */ diff --git a/src/plugins/python/weechat-python.c b/src/plugins/python/weechat-python.c index eccb9a1cd..63750885c 100644 --- a/src/plugins/python/weechat-python.c +++ b/src/plugins/python/weechat-python.c @@ -292,7 +292,7 @@ weechat_python_output_flush () char *temp_buffer, *command; int length; - if (!*python_buffer_output[0]) + if (!(*python_buffer_output)[0]) return; /* if there's no buffer, we catch the output, so there's no flush */ diff --git a/src/plugins/relay/api/remote/relay-remote-event.c b/src/plugins/relay/api/remote/relay-remote-event.c index 475f794a5..8222de6fb 100644 --- a/src/plugins/relay/api/remote/relay-remote-event.c +++ b/src/plugins/relay/api/remote/relay-remote-event.c @@ -156,7 +156,7 @@ relay_remote_build_string_tags (cJSON *json_tags, int line_id, int highlight) ptr_tag = cJSON_GetStringValue (json_tag); if (ptr_tag) { - if (*tags[0]) + if ((*tags)[0]) weechat_string_dyn_concat (tags, ",", -1); if (highlight && (strncmp (ptr_tag, "notify_", 7) == 0)) { @@ -177,14 +177,14 @@ relay_remote_build_string_tags (cJSON *json_tags, int line_id, int highlight) */ if (highlight && !tag_notify_highlight) { - if (*tags[0]) + if ((*tags)[0]) weechat_string_dyn_concat (tags, ",", -1); weechat_string_dyn_concat (tags, "notify_highlight", -1); } /* add tag with remote line id */ snprintf (str_tag_id, sizeof (str_tag_id), "relay_remote_line_id_%d", line_id); - if (*tags[0]) + if ((*tags)[0]) weechat_string_dyn_concat (tags, ",", -1); weechat_string_dyn_concat (tags, str_tag_id, -1); diff --git a/src/plugins/ruby/weechat-ruby.c b/src/plugins/ruby/weechat-ruby.c index 4e738431d..bfcf77b59 100644 --- a/src/plugins/ruby/weechat-ruby.c +++ b/src/plugins/ruby/weechat-ruby.c @@ -354,7 +354,7 @@ weechat_ruby_output_flush () char *temp_buffer, *command; int length; - if (!*ruby_buffer_output[0]) + if (!(*ruby_buffer_output)[0]) return; /* if there's no buffer, we catch the output, so there's no flush */ diff --git a/src/plugins/script/script-action.c b/src/plugins/script/script-action.c index 86db3acd8..b7d7d290f 100644 --- a/src/plugins/script/script-action.c +++ b/src/plugins/script/script-action.c @@ -123,7 +123,7 @@ script_action_run_list_input (struct t_gui_buffer *buffer, ptr_script = weechat_hdata_get_list (hdata, "scripts"); while (ptr_script) { - if (*output[0]) + if ((*output)[0]) { weechat_string_dyn_concat (output, ", ", -1); } @@ -152,7 +152,7 @@ script_action_run_list_input (struct t_gui_buffer *buffer, } } - if (!*output[0]) + if (!(*output)[0]) { weechat_string_dyn_concat ( output, @@ -1257,7 +1257,7 @@ script_action_add (struct t_gui_buffer *buffer, const char *action) return; } - if (*script_actions[0]) + if ((*script_actions)[0]) weechat_string_dyn_concat (script_actions, "\n", -1); weechat_string_dyn_concat ( diff --git a/src/plugins/typing/typing-bar-item.c b/src/plugins/typing/typing-bar-item.c index d24a6372d..ad01ddde1 100644 --- a/src/plugins/typing/typing-bar-item.c +++ b/src/plugins/typing/typing-bar-item.c @@ -54,7 +54,7 @@ typing_bar_item_nicks_map_cb (void *data, if ((ptr_typing_status->state == TYPING_STATUS_STATE_TYPING) || (ptr_typing_status->state == TYPING_STATUS_STATE_PAUSED)) { - if (*str_nicks_typing[0]) + if ((*str_nicks_typing)[0]) weechat_string_dyn_concat (str_nicks_typing, ", ", -1); if (ptr_typing_status->state == TYPING_STATUS_STATE_PAUSED) weechat_string_dyn_concat (str_nicks_typing, "(", -1);