diff --git a/src/rpc/cli.cpp b/src/rpc/cli.cpp index 5d7c903..dc63491 100644 --- a/src/rpc/cli.cpp +++ b/src/rpc/cli.cpp @@ -124,9 +124,8 @@ static char *my_rl_complete(char *token, int *match) const char* method_name; auto& cmd = cli_commands(); + int partlen = strlen (token); /* Part of token */ for (auto it : cmd) { - int partlen = strlen (token); /* Part of token */ - if (!strncmp (it.c_str(), token, partlen)) { method_name = it.c_str(); matchlen = partlen;