]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
client/cmdparser.c: Remove the leading spaces before calling the subparser. client...
authorizsh@fail0verflow.com <izsh@fail0verflow.com@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Sat, 6 Mar 2010 00:30:24 +0000 (00:30 +0000)
committerizsh@fail0verflow.com <izsh@fail0verflow.com@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Sat, 6 Mar 2010 00:30:24 +0000 (00:30 +0000)
client/cmdlfhid.c
client/cmdparser.c

index eb0d83a906e32b1dbc6d4c7d3f4b013e8fcb503d..344662e1dd23f61609f09676c8b12e7aa675e26e 100644 (file)
@@ -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);
index 0f97d7feede67730d0b7ea4813972de0fdbc0ed9..4f6e24635b7f3afd97015d6ac1a7c2838e08532b 100644 (file)
@@ -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);
+  }
 }
Impressum, Datenschutz