[PATCH] gatttool: Fix handle parsing in cmd_char_write()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



errno is not set to 0 before call to strtoll() so cmd_char_write() can fail
even with proper data. Use strtohandle() helper function instead.
---
 attrib/interactive.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/attrib/interactive.c b/attrib/interactive.c
index 0064ba2..073e3f7 100644
--- a/attrib/interactive.c
+++ b/attrib/interactive.c
@@ -601,8 +601,8 @@ static void cmd_char_write(int argcp, char **argvp)
 		return;
 	}
 
-	handle = strtoll(argvp[1], NULL, 16);
-	if (errno != 0 || handle <= 0) {
+	handle = strtohandle(argvp[1]);
+	if (handle <= 0) {
 		printf("A valid handle is required\n");
 		return;
 	}
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux