diff --git a/client/cmdlfhid.c b/client/cmdlfhid.c index eb0d83a90..344662e1d 100644 --- a/client/cmdlfhid.c +++ b/client/cmdlfhid.c @@ -46,7 +46,7 @@ int CmdHIDDemodFSK(const char *Cmd) int CmdHIDSim(const char *Cmd) { unsigned int hi = 0, lo = 0; - int n = 0, i = 1; + int n = 0, i = 0; while (sscanf(&Cmd[i++], "%1x", &n ) == 1) { hi = (hi << 4) | (lo >> 28); diff --git a/client/cmdparser.c b/client/cmdparser.c index 0f97d7fee..4f6e24635 100644 --- a/client/cmdparser.c +++ b/client/cmdparser.c @@ -50,9 +50,12 @@ void CmdsParse(const command_t Commands[], const char *Cmd) if(matches == 1) i=last_match; } - if (Commands[i].Name) + if (Commands[i].Name) { + while (Cmd[len] == ' ') + ++len; Commands[i].Parse(Cmd + len); - else + } else { // show help (always first in array) for selected hierarchy or if command not recognised CmdsHelp(Commands); + } }