mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-07-16 02:03:00 -07: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)
|
int CmdHIDSim(const char *Cmd)
|
||||||
{
|
{
|
||||||
unsigned int hi = 0, lo = 0;
|
unsigned int hi = 0, lo = 0;
|
||||||
int n = 0, i = 1;
|
int n = 0, i = 0;
|
||||||
|
|
||||||
while (sscanf(&Cmd[i++], "%1x", &n ) == 1) {
|
while (sscanf(&Cmd[i++], "%1x", &n ) == 1) {
|
||||||
hi = (hi << 4) | (lo >> 28);
|
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(matches == 1) i=last_match;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Commands[i].Name)
|
if (Commands[i].Name) {
|
||||||
|
while (Cmd[len] == ' ')
|
||||||
|
++len;
|
||||||
Commands[i].Parse(Cmd + len);
|
Commands[i].Parse(Cmd + len);
|
||||||
else
|
} else {
|
||||||
// show help (always first in array) for selected hierarchy or if command not recognised
|
// show help (always first in array) for selected hierarchy or if command not recognised
|
||||||
CmdsHelp(Commands);
|
CmdsHelp(Commands);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue