From 8fe4c84b727972d44a7b11e6a1f52d50bbc004c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 25 Mar 2023 18:04:08 +0100 Subject: core: fix uninitialized variable `chunks2_count` when key_name and key_name_alias are the same --- src/gui/gui-key.c | 11 +++++++++-- 1 file 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) -- cgit v1.2.3