aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrzej Kaczmarek <andrzej.kaczmarek@tieto.com>2012-04-25 17:25:19 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2012-04-26 12:12:18 +0300
commitdbe0ed14d5e12f76408e6f7f91ce6d3944fd2722 (patch)
tree7322d42154bd89a0ed0509411397e95e83b58e33
parentf763bc0cd82a49854dd13f702383c9bdebc8178b (diff)
downloadbluez-dbe0ed14d5e12f76408e6f7f91ce6d3944fd2722.tar.gz
bluez-dbe0ed14d5e12f76408e6f7f91ce6d3944fd2722.tar.xz
bluez-dbe0ed14d5e12f76408e6f7f91ce6d3944fd2722.zip
gatttool: Fix handle parsing in cmd_char_write()
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.
-rw-r--r--attrib/interactive.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/attrib/interactive.c b/attrib/interactive.c
index 0064ba2b..073e3f7a 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;
}