diff options
author | Christian Soffke <christian.soffke@gmail.com> | 2022-11-19 22:19:15 +0100 |
---|---|---|
committer | Christian Soffke <christian.soffke@gmail.com> | 2022-11-19 22:19:15 +0100 |
commit | 8fe42c43c6c62a8f593ee337902f8919ed2152ad (patch) | |
tree | 2fff1328cf40f66543fe93b172586a13770de955 /apps/onplay.c | |
parent | dcde5aa89daaa9906b04770ab18def9c146474c4 (diff) | |
download | rockbox-8fe42c43c6c62a8f593ee337902f8919ed2152ad.tar.gz rockbox-8fe42c43c6c62a8f593ee337902f8919ed2152ad.zip |
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
Diffstat (limited to 'apps/onplay.c')
-rw-r--r-- | apps/onplay.c | 7 |
1 files 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) | |||
1828 | return ONPLAY_RELOAD_DIR; | 1828 | return ONPLAY_RELOAD_DIR; |
1829 | } | 1829 | } |
1830 | 1830 | ||
1831 | static void hotkey_run_plugin(void) | 1831 | static int hotkey_run_plugin(void) |
1832 | { | 1832 | { |
1833 | open_plugin_run(ID2P(LANG_HOTKEY_WPS)); | 1833 | open_plugin_run(ID2P(LANG_HOTKEY_WPS)); |
1834 | return ONPLAY_OK; | ||
1834 | } | 1835 | } |
1835 | 1836 | ||
1836 | struct hotkey_assignment { | 1837 | struct hotkey_assignment { |
1837 | int action; /* hotkey_action */ | 1838 | int action; /* hotkey_action */ |
1838 | int lang_id; /* Language ID */ | 1839 | int lang_id; /* Language ID */ |
1839 | struct menu_func func; /* Function to run if this entry is selected */ | 1840 | struct menu_func func; /* Function to run if this entry is selected */ |
1840 | int return_code; /* What to return after the function is run */ | 1841 | int return_code; /* What to return after the function is run. ONPLAY_OK here */ |
1841 | }; | 1842 | }; /* means to use function return code, see execute_hotkey */ |
1842 | 1843 | ||
1843 | #define HOTKEY_FUNC(func, param) {{(void *)func}, param} | 1844 | #define HOTKEY_FUNC(func, param) {{(void *)func}, param} |
1844 | 1845 | ||