]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
Fix filenames for hf mf esave / eload 106/head
authorPierre LALET <pierre.lalet@cea.fr>
Sun, 24 May 2015 18:14:22 +0000 (20:14 +0200)
committerPierre LALET <pierre.lalet@cea.fr>
Sun, 24 May 2015 18:14:22 +0000 (20:14 +0200)
client/cmdhfmf.c

index aa3b66dc64b960f2bf855b62257f904b26196a4e..407f34a0ee7195ec6ba8e1aa5c60ea3b4f4a589d 100644 (file)
@@ -1200,9 +1200,9 @@ int CmdHF14AMfELoad(const char *Cmd)
 \r
        len = param_getstr(Cmd,nameParamNo,filename);\r
        \r
-       if (len > FILE_PATH_SIZE) len = FILE_PATH_SIZE;\r
+       if (len > FILE_PATH_SIZE - 4) len = FILE_PATH_SIZE - 4;\r
 \r
-       fnameptr += len-4;\r
+       fnameptr += len;\r
 \r
        sprintf(fnameptr, ".eml"); \r
        \r
@@ -1299,19 +1299,22 @@ int CmdHF14AMfESave(const char *Cmd)
 \r
        len = param_getstr(Cmd,nameParamNo,filename);\r
        \r
-       if (len > FILE_PATH_SIZE) len = FILE_PATH_SIZE;\r
+       if (len > FILE_PATH_SIZE - 4) len = FILE_PATH_SIZE - 4;\r
        \r
        // user supplied filename?\r
        if (len < 1) {\r
                // get filename (UID from memory)\r
                if (mfEmlGetMem(buf, 0, 1)) {\r
                        PrintAndLog("Can\'t get UID from block: %d", 0);\r
-                       sprintf(filename, "dump.eml"); \r
+                       len = sprintf(fnameptr, "dump");\r
+                       fnameptr += len;\r
+               }\r
+               else {\r
+                       for (j = 0; j < 7; j++, fnameptr += 2)\r
+                               sprintf(fnameptr, "%02X", buf[j]);\r
                }\r
-               for (j = 0; j < 7; j++, fnameptr += 2)\r
-                       sprintf(fnameptr, "%02X", buf[j]); \r
        } else {\r
-               fnameptr += len-4;\r
+               fnameptr += len;\r
        }\r
 \r
        // add file extension\r
Impressum, Datenschutz