Diff between cf866e55ad00abb29d1e3ff913969edcc5810d35 and a627729717df3ba3ef36d4a6a6703ee007dceb07

Changed Files

File Additions Deletions Status
tools/sco-tester.c +10 -3 modified

Full Patch

diff --git a/tools/sco-tester.c b/tools/sco-tester.c
index db45ef0..1ad48db 100644
--- a/tools/sco-tester.c
+++ b/tools/sco-tester.c
@@ -331,8 +331,9 @@ static void test_getsockopt(const void *test_data)
 		return;
 	}
 
-	voice.setting = 0;
 	len = sizeof(voice);
+	memset(&voice, 0, len);
+
 	err = getsockopt(sk, SOL_BLUETOOTH, BT_VOICE, &voice, &len);
 	if (err < 0) {
 		tester_warn("Can't get socket option : %s (%d)",
@@ -368,8 +369,9 @@ static void test_setsockopt(const void *test_data)
 	}
 
 
-	voice.setting = 0;
 	len = sizeof(voice);
+	memset(&voice, 0, len);
+
 	err = getsockopt(sk, SOL_BLUETOOTH, BT_VOICE, &voice, &len);
 	if (err < 0) {
 		tester_warn("Can't get socket option : %s (%d)",
@@ -384,7 +386,9 @@ static void test_setsockopt(const void *test_data)
 		goto end;
 	}
 
+	memset(&voice, 0, sizeof(voice));
 	voice.setting = BT_VOICE_TRANSPARENT;
+
 	err = setsockopt(sk, SOL_BLUETOOTH, BT_VOICE, &voice, sizeof(voice));
 	if (err < 0) {
 		tester_warn("Can't set socket option : %s (%d)",
@@ -393,8 +397,9 @@ static void test_setsockopt(const void *test_data)
 		goto end;
 	}
 
-	voice.setting = 0;
 	len = sizeof(voice);
+	memset(&voice, 0, len);
+
 	err = getsockopt(sk, SOL_BLUETOOTH, BT_VOICE, &voice, &len);
 	if (err < 0) {
 		tester_warn("Can't get socket option : %s (%d)",
@@ -549,7 +554,9 @@ static void test_connect_transp(const void *test_data)
 		return;
 	}
 
+	memset(&voice, 0, sizeof(voice));
 	voice.setting = BT_VOICE_TRANSPARENT;
+
 	err = setsockopt(sk, SOL_BLUETOOTH, BT_VOICE, &voice, sizeof(voice));
 	if (err < 0) {
 		tester_warn("Can't set socket option : %s (%d)",