From: Shaun Ren <sren@codeweavers.com> --- dlls/xinput1_3/main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/xinput1_3/main.c b/dlls/xinput1_3/main.c index 7fbf0616b29..f6329a22b8d 100644 --- a/dlls/xinput1_3/main.c +++ b/dlls/xinput1_3/main.c @@ -470,15 +470,19 @@ static BOOL open_device_at_index(const WCHAR *device_path, int index) return TRUE; } -static BOOL find_opened_device(const WCHAR *device_path, int *free_slot) +static BOOL find_opened_device(const WCHAR *device_path, int *slot) { int i; - *free_slot = XUSER_MAX_COUNT; + *slot = XUSER_MAX_COUNT; for (i = XUSER_MAX_COUNT; i > 0; i--) { - if (!controllers[i - 1].device) *free_slot = i - 1; - else if (!wcsicmp(device_path, controllers[i - 1].device_path)) return TRUE; + if (!controllers[i - 1].device) *slot = i - 1; + else if (!wcsicmp(device_path, controllers[i - 1].device_path)) + { + *slot = i - 1; + return TRUE; + } } return FALSE; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11139