]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlfhitag.c
CHG: Added @icsom 's changes to his legic.lua script.
[proxmark3-svn] / client / cmdlfhitag.c
index bd2e47a8fbd34a62ac837ac8c8c77e40a58dbfdf..95d85c6e1c65f47897da3bc80a274d7073d7317e 100644 (file)
@@ -173,7 +173,8 @@ int CmdLFHitagSim(const char *Cmd) {
                        return 1;
                }
                tag_mem_supplied = true;
-               if (fread(c.d.asBytes,48,1,pf) == 0) {
+               size_t bytes_read = fread(c.d.asBytes, 48, 1, pf);
+               if ( bytes_read == 0) {
                        PrintAndLog("Error: File reading error");
                        fclose(pf);
                        return 1;
@@ -266,14 +267,13 @@ static command_t CommandTable[] = {
        {NULL, NULL, 0, NULL}
 };
 
-int CmdLFHitag(const char *Cmd)
-{
+int CmdLFHitag(const char *Cmd) {
+       clearCommandBuffer();
        CmdsParse(CommandTable, Cmd);
        return 0;
 }
 
-int CmdHelp(const char *Cmd)
-{
+int CmdHelp(const char *Cmd) {
        CmdsHelp(CommandTable);
        return 0;
 }
Impressum, Datenschutz