From 4d3c2e309e5a9fad2527f60e2e55b25dc3976d7c Mon Sep 17 00:00:00 2001 From: Dee HY Date: Sun, 18 Jan 2026 18:12:51 +0800 Subject: [PATCH] fix: initialize variables to prevent potentially uninitialized usage Fixed compiler warnings about potentially uninitialized variables in handle_key_down and hkm_unregister functions by adding else clauses to set default empty string values. --- .../hotkey_manager_linux/linux/hotkey_manager_linux_plugin.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/hotkey_manager_linux/linux/hotkey_manager_linux_plugin.cc b/packages/hotkey_manager_linux/linux/hotkey_manager_linux_plugin.cc index 74fabe2..f3d9f51 100644 --- a/packages/hotkey_manager_linux/linux/hotkey_manager_linux_plugin.cc +++ b/packages/hotkey_manager_linux/linux/hotkey_manager_linux_plugin.cc @@ -40,6 +40,8 @@ void handle_key_down(const char* keystring, void* user_data) { if (result != hotkey_id_map.end()) identifier = result->first.c_str(); + else + identifier = ""; g_autoptr(FlValue) event_data = fl_value_new_map(); fl_value_set_string_take(event_data, "identifier", @@ -111,6 +113,8 @@ static FlMethodResponse* hkm_unregister(_HotkeyManagerLinuxPlugin* self, if (result != hotkey_id_map.end()) keystring = result->second.c_str(); + else + keystring = ""; keybinder_unbind(keystring, handle_key_down); hotkey_id_map.erase(identifier);