mirror of
https://github.com/Lekensteyn/ltunify.git
synced 2025-12-10 10:25:34 +00:00
Use correct index in process_notif_dev_connect
`devices[dev_idx]` should have been `devices[dev_idx - 1]`, aka `dev`.
This commit is contained in:
@@ -427,7 +427,7 @@ bool process_notif_dev_connect(struct hidpp_message *msg, u8 *device_index,
|
|||||||
if (device_index) *device_index = dev_idx;
|
if (device_index) *device_index = dev_idx;
|
||||||
if (is_new_device) *is_new_device = !dev->device_present;
|
if (is_new_device) *is_new_device = !dev->device_present;
|
||||||
|
|
||||||
memset(&devices[dev_idx], 0, sizeof devices[dev_idx]);
|
memset(dev, 0, sizeof *dev);
|
||||||
dev->device_type = dcon->device_info & DEVCON_DEV_TYPE_MASK;
|
dev->device_type = dcon->device_info & DEVCON_DEV_TYPE_MASK;
|
||||||
dev->wireless_pid = (dcon->pid_msb << 8) | dcon->pid_lsb;
|
dev->wireless_pid = (dcon->pid_msb << 8) | dcon->pid_lsb;
|
||||||
dev->device_present = true;
|
dev->device_present = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user