mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-12-29 11:52:59 +08:00
client/cmdparser.c: Remove the leading spaces before calling the subparser. client/cmdlfhid.c: Modify accordingly.
This commit is contained in:
parent
f443ff3ebc
commit
035303ac5f
2 changed files with 6 additions and 3 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue