diff --git a/src/detection/gamepad/gamepad_bsd.c b/src/detection/gamepad/gamepad_bsd.c index fa68b46fc..21631e9a0 100644 --- a/src/detection/gamepad/gamepad_bsd.c +++ b/src/detection/gamepad/gamepad_bsd.c @@ -53,6 +53,7 @@ const char* ffDetectGamepad(FFlist* devices /* List of FFGamepadDevice */) device->battery = 0; } } + hid_end_parse(hData); } hid_dispose_report_desc(repDesc); diff --git a/src/detection/mouse/mouse_bsd.c b/src/detection/mouse/mouse_bsd.c index cb99a47cf..5052475bf 100644 --- a/src/detection/mouse/mouse_bsd.c +++ b/src/detection/mouse/mouse_bsd.c @@ -11,12 +11,12 @@ #include // DragonFly #endif -#define MAX_UHID_JOYS 64 +#define MAX_UHID_MICE 64 const char* ffDetectMouse(FFlist* devices /* List of FFMouseDevice */) { char path[16]; - for (int i = 0; i < MAX_UHID_JOYS; i++) + for (int i = 0; i < MAX_UHID_MICE; i++) { snprintf(path, ARRAY_SIZE(path), "/dev/uhid%d", i); FF_AUTO_CLOSE_FD int fd = open(path, O_RDONLY | O_CLOEXEC); @@ -43,6 +43,7 @@ const char* ffDetectMouse(FFlist* devices /* List of FFMouseDevice */) ffStrbufInitS(&device->name, di.udi_product); } } + hid_end_parse(hData); } hid_dispose_report_desc(repDesc);