diff --git a/tools/btmgmt.c b/tools/btmgmt.c
index 15425fb..75f64c2 100644
--- a/tools/btmgmt.c
+++ b/tools/btmgmt.c
char **matches = NULL;
if (start > 0) {
- int i;
+ unsigned int i;
- for (i = 0; all_cmd[i].cmd; i++) {
+ for (i = 0; i < NELEM(all_cmd); i++) {
struct cmd_info *c = &all_cmd[i];
if (strncmp(c->cmd, rl_line_buffer, start - 1))
static void usage(void)
{
- int i;
+ unsigned int i;
printf("btmgmt ver %s\n", VERSION);
printf("Usage:\n"
"\t--help\tDisplay help\n");
printf("Commands:\n");
- for (i = 0; all_cmd[i].cmd; i++)
+ for (i = 0; i < NELEM(all_cmd); i++)
printf("\t%-15s\t%s\n", all_cmd[i].cmd, all_cmd[i].doc);
printf("\n"