From: izsh@fail0verflow.com Date: Sat, 6 Mar 2010 00:30:24 +0000 (+0000) Subject: client/cmdparser.c: Remove the leading spaces before calling the subparser. client... X-Git-Tag: v1.0.0~286 X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/035303ac5f3e5e38cfa79a3a4c0d0bf76e70bd6b client/cmdparser.c: Remove the leading spaces before calling the subparser. client/cmdlfhid.c: Modify accordingly. --- diff --git a/client/cmdlfhid.c b/client/cmdlfhid.c index eb0d83a9..344662e1 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 0f97d7fe..4f6e2463 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); + } }