From dbe0ed14d5e12f76408e6f7f91ce6d3944fd2722 Mon Sep 17 00:00:00 2001 From: Andrzej Kaczmarek Date: Wed, 25 Apr 2012 17:25:19 +0200 Subject: [PATCH] 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. --- attrib/interactive.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attrib/interactive.c b/attrib/interactive.c index 0064ba2b7..073e3f7a7 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; } -- 2.47.3