OSDN Git Service

tools/btgatt-client: Fix set-security interactive command
authorMaxime Chevallier <maxime.chevallier@smile.fr>
Thu, 22 Dec 2016 10:36:04 +0000 (11:36 +0100)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 28 Dec 2016 09:12:13 +0000 (11:12 +0200)
Fix the interactive "set-security" command in btgatt-client, that would
always fail due to bad initialization of argv buffer :

[GATT client]# set-security 2
Usage: set_security <level>
level: 1-3
e.g.:
        set-sec-level 2

tools/btgatt-client.c

index 0374a84..a76edb8 100644 (file)
@@ -1198,8 +1198,7 @@ static void set_security_usage(void)
 
 static void cmd_set_security(struct client *cli, char *cmd_str)
 {
-       char *argvbuf[1];
-       char **argv = argvbuf;
+       char *argv[2];
        int argc = 0;
        char *endptr = NULL;
        int level;