client: Fix setting of advertisement interval
authorInga Stotland <inga.stotland@intel.com>
Fri, 20 May 2022 23:41:51 +0000 (16:41 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:54 +0000 (14:55 +0530)
This fixes incorrect argument read when using "interval" command
in "advertisement" submenu

Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
client/main.c

index a13542c..ade45f2 100644 (file)
@@ -2774,7 +2774,7 @@ static void cmd_advertise_interval(int argc, char *argv[])
        max = min;
 
        if (argc > 2) {
-               max = strtol(argv[1], &endptr, 0);
+               max = strtol(argv[2], &endptr, 0);
                if (!endptr || *endptr != '\0' || max < 20 || max > 10485) {
                        bt_shell_printf("Invalid argument\n");
                        return bt_shell_noninteractive_quit(EXIT_FAILURE);