summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Wu <rob@robwu.nl>2018-03-30 16:33:52 +0200
committerRob Wu <rob@robwu.nl>2018-03-30 16:36:37 +0200
commitf664d1d41d5c4beeac5b81e485c3498f13109db7 (patch)
tree5471462688eea4ba05ec712e6ec15dec3bef64e7
parent955b9feb9e7881f07896e19491ae1b5cc728c4d8 (diff)
downloadltunify-master.tar.gz
Use correct index in process_notif_dev_connectHEADmaster
`devices[dev_idx]` should have been `devices[dev_idx - 1]`, aka `dev`.
-rw-r--r--ltunify.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ltunify.c b/ltunify.c
index d5c7a54..c82d96f 100644
--- a/ltunify.c
+++ b/ltunify.c
@@ -427,7 +427,7 @@ bool process_notif_dev_connect(struct hidpp_message *msg, u8 *device_index,
if (device_index) *device_index = dev_idx;
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->wireless_pid = (dcon->pid_msb << 8) | dcon->pid_lsb;
dev->device_present = true;