From 8fe42c43c6c62a8f593ee337902f8919ed2152ad Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Sat, 19 Nov 2022 22:19:15 +0100 Subject: WPS plugin hotkey: Fix UB HOTKEY_PLUGIN action resulted in return value of void function being assigned and then returned by execute_hotkey. Change-Id: I8b141e878fc2c0b09070186fc3520314c18a83b0 --- apps/onplay.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/onplay.c b/apps/onplay.c index 0172f96c21..2a4b36fae6 100644 --- a/apps/onplay.c +++ b/apps/onplay.c @@ -1828,17 +1828,18 @@ static int tree_hotkey_run_plugin(void *param) return ONPLAY_RELOAD_DIR; } -static void hotkey_run_plugin(void) +static int hotkey_run_plugin(void) { open_plugin_run(ID2P(LANG_HOTKEY_WPS)); + return ONPLAY_OK; } struct hotkey_assignment { int action; /* hotkey_action */ int lang_id; /* Language ID */ struct menu_func func; /* Function to run if this entry is selected */ - int return_code; /* What to return after the function is run */ -}; + int return_code; /* What to return after the function is run. ONPLAY_OK here */ +}; /* means to use function return code, see execute_hotkey */ #define HOTKEY_FUNC(func, param) {{(void *)func}, param} -- cgit v1.2.3