diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2023-03-25 18:04:08 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2023-03-25 18:04:08 +0100 |
commit | 8fe4c84b727972d44a7b11e6a1f52d50bbc004c7 (patch) | |
tree | 2c214ca973304e6fe679069580ac0b1b5cf55721 | |
parent | 94cbed25853bcb4d43a4468eb9ee0cc3f42b0595 (diff) | |
download | weechat-8fe4c84b727972d44a7b11e6a1f52d50bbc004c7.zip |
core: fix uninitialized variable `chunks2_count` when key_name and key_name_alias are the same
-rw-r--r-- | src/gui/gui-key.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/gui-key.c b/src/gui/gui-key.c index 1a43332af..5455b6d13 100644 --- a/src/gui/gui-key.c +++ b/src/gui/gui-key.c @@ -2405,8 +2405,15 @@ gui_key_pressed (const char *key_str) exact_match = 0; chunks1 = string_split (key_name, ",", NULL, 0, 0, &chunks1_count); - chunks2 = (string_strcmp (key_name, key_name_alias) != 0) ? - string_split (key_name_alias, ",", NULL, 0, 0, &chunks2_count) : NULL; + if (string_strcmp (key_name, key_name_alias) != 0) + { + chunks2 = string_split (key_name_alias, ",", NULL, 0, 0, &chunks2_count); + } + else + { + chunks2 = NULL; + chunks2_count = 0; + } context = gui_key_get_current_context (); switch (context) |