From 017e6d8ad0773939273d98e120a2b077acf75a71 Mon Sep 17 00:00:00 2001 From: Magnus Larsen Date: Sun, 1 Dec 2024 17:17:51 -0800 Subject: [PATCH] Address review feedback --- src/controller/controller.c | 5 +++-- src/controller/joystick.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/controller/controller.c b/src/controller/controller.c index ca23981d0..7dedcca4c 100644 --- a/src/controller/controller.c +++ b/src/controller/controller.c @@ -95,8 +95,9 @@ void controller_cmd(controller *ctrl, int action, ctrl_event **ev) { iterator it; hook_function **p = 0; list_iter_begin(&ctrl->hooks, &it); - while((p = iter_next(&it)) != NULL) { - ((*p)->fp)((*p)->source, action); + while((p = iter_next(&it))) { + hook_function hook = **p; + (hook.fp)(hook.source, action); } ctrl_action_push(ev, action); diff --git a/src/controller/joystick.c b/src/controller/joystick.c index 84aee2a92..8a7ef0b25 100644 --- a/src/controller/joystick.c +++ b/src/controller/joystick.c @@ -238,7 +238,7 @@ void joystick_menu_poll_all(controller *menu_ctrl, ctrl_event **ev) { return; joystick k; - memset(&k, 0, sizeof k); + memset(&k, 0, sizeof(k)); joystick_keys keys; internal_joystick_default_keys(&keys); k.keys = &keys;