]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhfmf.c
FIX: downloaded a fresh clone from my fork, and took away the build-errors.
[proxmark3-svn] / client / cmdhfmf.c
index f32ae444f077271a41ec6f96030b1e16b1154be4..49928c9aef2d4ddf508fd82851a9b511bec70743 100644 (file)
@@ -1223,9 +1223,6 @@ int CmdHF14AMfELoad(const char *Cmd)
                return 1;\r
        }\r
        \r
-//             for (sectorNo = 0; sectorNo < numSectors; sectorNo++) {\r
-//             for(blockNo = 0; blockNo < NumBlocksPerSector(sectorNo); blockNo++) {\r
-       \r
        blockNum = 0;\r
        while(!feof(f)){\r
                memset(buf, 0, sizeof(buf));\r
@@ -1243,6 +1240,7 @@ int CmdHF14AMfELoad(const char *Cmd)
                        if(strlen(buf) && feof(f))\r
                                break;\r
                        PrintAndLog("File content error. Block data must include 32 HEX symbols");\r
+                       fclose(f);\r
                        return 2;\r
                }\r
                \r
@@ -1252,6 +1250,7 @@ int CmdHF14AMfELoad(const char *Cmd)
                \r
                if (mfEmlSetMem(buf8, blockNum, 1)) {\r
                        PrintAndLog("Cant set emul block: %3d", blockNum);\r
+                       fclose(f);\r
                        return 3;\r
                }\r
                blockNum++;\r
@@ -1262,7 +1261,6 @@ int CmdHF14AMfELoad(const char *Cmd)
        \r
        if ((blockNum != numBlocks)) {\r
                PrintAndLog("File content error. Got %d must be %d blocks.",blockNum, numBlocks);\r
-               fclose(f);\r
                return 4;\r
        }\r
        PrintAndLog("Loaded %d blocks from file: %s", blockNum, filename);\r
Impressum, Datenschutz