summaryrefslogtreecommitdiffstats
path: root/cups/hcrp.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2004-12-25 17:43:16 +0000
committerMarcel Holtmann <marcel@holtmann.org>2004-12-25 17:43:16 +0000
commitbbda499067067aefc8e642a2784d247ac0331eae (patch)
treea702f2c2ba1716b29c5f3b4d019c4590330ff461 /cups/hcrp.c
parentac243219976dab3363bcd3215f963eb0026af788 (diff)
Add memset() to different places to initialize the structures
Diffstat (limited to 'cups/hcrp.c')
-rw-r--r--cups/hcrp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/cups/hcrp.c b/cups/hcrp.c
index f69800a7..75171524 100644
--- a/cups/hcrp.c
+++ b/cups/hcrp.c
@@ -187,9 +187,9 @@ int hcrp_print(bdaddr_t *src, bdaddr_t *dst, unsigned short ctrl_psm, unsigned s
return 1;
}
+ memset(&addr, 0, sizeof(addr));
addr.l2_family = AF_BLUETOOTH;
bacpy(&addr.l2_bdaddr, src);
- addr.l2_psm = 0;
if (bind(ctrl_sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
perror("ERROR: Can't bind socket");
@@ -197,6 +197,7 @@ int hcrp_print(bdaddr_t *src, bdaddr_t *dst, unsigned short ctrl_psm, unsigned s
return 1;
}
+ memset(&addr, 0, sizeof(addr));
addr.l2_family = AF_BLUETOOTH;
bacpy(&addr.l2_bdaddr, dst);
addr.l2_psm = htobs(ctrl_psm);
@@ -213,9 +214,9 @@ int hcrp_print(bdaddr_t *src, bdaddr_t *dst, unsigned short ctrl_psm, unsigned s
return 1;
}
+ memset(&addr, 0, sizeof(addr));
addr.l2_family = AF_BLUETOOTH;
bacpy(&addr.l2_bdaddr, src);
- addr.l2_psm = 0;
if (bind(data_sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
perror("ERROR: Can't bind socket");
@@ -224,6 +225,7 @@ int hcrp_print(bdaddr_t *src, bdaddr_t *dst, unsigned short ctrl_psm, unsigned s
return 1;
}
+ memset(&addr, 0, sizeof(addr));
addr.l2_family = AF_BLUETOOTH;
bacpy(&addr.l2_bdaddr, dst);
addr.l2_psm = htobs(data_psm);
@@ -235,6 +237,7 @@ int hcrp_print(bdaddr_t *src, bdaddr_t *dst, unsigned short ctrl_psm, unsigned s
return 1;
}
+ memset(&opts, 0, sizeof(opts));
size = sizeof(opts);
if (getsockopt(data_sk, SOL_L2CAP, L2CAP_OPTIONS, &opts, &size) < 0) {