diff --git a/tools/btmgmt.c b/tools/btmgmt.c
index e262350..0686ed6 100644
--- a/tools/btmgmt.c
+++ b/tools/btmgmt.c
static char *cmd_generator(const char *text, int state)
{
- static int index, len;
+ static int i, j, len;
const char *cmd;
if (!state) {
- index = 0;
+ i = 0;
+ j = 0;
len = strlen(text);
}
- while ((cmd = all_cmd[index].cmd)) {
- index++;
+ while ((cmd = all_cmd[i].cmd)) {
+ i++;
if (!strncmp(cmd, text, len))
return strdup(cmd);
}
- while ((cmd = interactive_cmd[index].cmd)) {
- index++;
+ while ((cmd = interactive_cmd[j].cmd)) {
+ j++;
if (!strncmp(cmd, text, len))
return strdup(cmd);