diff mbox series

[BlueZ,1/2] btiotest: Correct setting of addr_type for big-endian platforms

Message ID 418845b9-28e1-4356-9ce2-b422720bf948@EXC04-ATKLA.omicron.at
State New
Headers show
Series [BlueZ,1/2] btiotest: Correct setting of addr_type for big-endian platforms | expand

Commit Message

Mark Marshall Aug. 19, 2020, 1:22 p.m. UTC
The glibc option parser expects the option values pointed to by
G_OPTION_ARG_INT to be an int, so a guint8 is wrong in all cases,
but on a big-endian platform you can't even change the addr_type.
(On little endian, it would appear to work).
---
 tools/btiotest.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/tools/btiotest.c b/tools/btiotest.c
index 6c778e3c5..d56bb4fda 100644
--- a/tools/btiotest.c
+++ b/tools/btiotest.c
@@ -556,7 +556,7 @@  static int opt_sec = 0;
 static gboolean opt_master = FALSE;
 static int opt_priority = 0;
 static int opt_cid = 0;
-static guint8 opt_addr_type = 0;
+static int opt_addr_type = 0;
 
 static GMainLoop *main_loop;
 
@@ -616,8 +616,9 @@  int main(int argc, char *argv[])
 	g_option_context_free(context);
 
 	printf("accept=%d reject=%d discon=%d defer=%d sec=%d update_sec=%d"
-		" prio=%d voice=0x%04x\n", opt_accept, opt_reject, opt_disconn,
-		opt_defer, opt_sec, opt_update_sec, opt_priority, opt_voice);
+		" prio=%d voice=0x%04x addr_type=%u\n", opt_accept, opt_reject, opt_disconn,
+		opt_defer, opt_sec, opt_update_sec, opt_priority, opt_voice,
+		opt_addr_type);
 
 	if (opt_psm || opt_cid) {
 		if (argc > 1)