]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhfmf.c
Adjustments after the big merge from PM3 master.
[proxmark3-svn] / client / cmdhfmf.c
index a4986f6bf28ffe591ea568eeaf73882b35df5037..676a8884c863f30ffbcae7d1a63adead2d1036f8 100644 (file)
@@ -1202,7 +1202,7 @@ int CmdHF14AMfELoad(const char *Cmd)
        \r
        if (len > FILE_PATH_SIZE) len = FILE_PATH_SIZE;\r
 \r
-       fnameptr += len;\r
+       fnameptr += len-4;\r
 \r
        sprintf(fnameptr, ".eml"); \r
        \r
@@ -1592,7 +1592,9 @@ int CmdHF14AMfCLoad(const char *Cmd)
                        memset(buf, 0, sizeof(buf));\r
                        \r
                        if (fgets(buf, sizeof(buf), f) == NULL) {\r
+                               fclose(f);\r
                                PrintAndLog("File reading error.");\r
+                               fclose(f);\r
                                return 2;\r
                        }\r
 \r
@@ -1600,6 +1602,7 @@ int CmdHF14AMfCLoad(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
                        for (i = 0; i < 32; i += 2)\r
Impressum, Datenschutz