diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2007-10-12 11:00:32 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2007-10-12 11:00:32 +0000 |
commit | 3571ae843629585caf996c73200bbbfd05c260a6 (patch) | |
tree | f07ed2281fbc83a4c486c47451bc1d7055f22ede /input | |
parent | f6d1f79b0382b03dc01d3bb823c8c3eb70f82457 (diff) |
Fix hidp_connad_req usage
Diffstat (limited to 'input')
-rw-r--r-- | input/device.c | 6 | ||||
-rw-r--r-- | input/manager.c | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/input/device.c b/input/device.c index 59dbc5bb..33a00f7e 100644 --- a/input/device.c +++ b/input/device.c @@ -800,7 +800,7 @@ static int disconnect(struct device *idev, uint32_t flags) return -errno; } - memset(&ci, 0, sizeof(struct hidp_conninfo)); + memset(&ci, 0, sizeof(ci)); bacpy(&ci.bdaddr, &idev->dst); if ((ioctl(ctl, HIDPGETCONNINFO, &ci) < 0) || (ci.state != BT_CONNECTED)) { @@ -808,7 +808,7 @@ static int disconnect(struct device *idev, uint32_t flags) goto fail; } - memset(&req, 0, sizeof(struct hidp_conndel_req)); + memset(&req, 0, sizeof(req)); bacpy(&req.bdaddr, &idev->dst); req.flags = flags; if (ioctl(ctl, HIDPCONNDEL, &req) < 0) { @@ -847,7 +847,7 @@ static int is_connected(struct device *idev) if (ctl < 0) return 0; - memset(&ci, 0, sizeof(struct hidp_conninfo)); + memset(&ci, 0, sizeof(ci)); bacpy(&ci.bdaddr, &idev->dst); if (ioctl(ctl, HIDPGETCONNINFO, &ci) < 0) { close(ctl); diff --git a/input/manager.c b/input/manager.c index cd2e8a1d..13e5cdba 100644 --- a/input/manager.c +++ b/input/manager.c @@ -288,6 +288,8 @@ static gboolean interrupt_connect_cb(GIOChannel *chan, int isk, ret, err; socklen_t len; + memset(&hidp, 0, sizeof(hidp)); + isk = g_io_channel_unix_get_fd(chan); if (cond & G_IO_NVAL) { @@ -316,7 +318,6 @@ static gboolean interrupt_connect_cb(GIOChannel *chan, goto failed; } - memset(&hidp, 0, sizeof(struct hidp_connadd_req)); extract_hid_record(pr->hid_rec, &hidp); if (pr->pnp_rec) extract_pnp_record(pr->pnp_rec, &hidp); @@ -1045,7 +1046,7 @@ static void stored_input(char *key, char *value, void *data) str2ba(key, &dst); - memset(&hidp, 0, sizeof(struct hidp_connadd_req)); + memset(&hidp, 0, sizeof(hidp)); if (parse_stored_device_info(value, &hidp) < 0) return; @@ -1080,7 +1081,7 @@ static void stored_hidd(char *key, char *value, void *data) return; } - memset(&hidp, 0, sizeof(struct hidp_connadd_req)); + memset(&hidp, 0, sizeof(hidp)); if (parse_stored_hidd(value, &hidp) < 0) return; |