]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Merge pull request #107 from p-l-/fix-hfmf
authorMartin Holst Swende <martin@swende.se>
Sun, 24 May 2015 21:10:21 +0000 (23:10 +0200)
committerMartin Holst Swende <martin@swende.se>
Sun, 24 May 2015 21:10:21 +0000 (23:10 +0200)
Fix filenames for hf mf cload / csave

client/cmdhfmf.c

index 407f34a0ee7195ec6ba8e1aa5c60ea3b4f4a589d..2b5a5b87965dd7b36e283e9f94fe876f2e740dc7 100644 (file)
@@ -1575,10 +1575,10 @@ int CmdHF14AMfCLoad(const char *Cmd)
                return 0;\r
        } else {\r
                len = strlen(Cmd);\r
-               if (len > FILE_PATH_SIZE) len = FILE_PATH_SIZE;\r
+               if (len > FILE_PATH_SIZE - 4) len = FILE_PATH_SIZE - 4;\r
 \r
                memcpy(filename, Cmd, len);\r
-               fnameptr += len-4;\r
+               fnameptr += len;\r
 \r
                sprintf(fnameptr, ".eml"); \r
        \r
@@ -1744,7 +1744,7 @@ int CmdHF14AMfCSave(const char *Cmd) {
                return 0;\r
        } else {\r
                len = strlen(Cmd);\r
-               if (len > FILE_PATH_SIZE) len = FILE_PATH_SIZE;\r
+               if (len > FILE_PATH_SIZE - 4) len = FILE_PATH_SIZE - 4;\r
        \r
                if (len < 1) {\r
                        // get filename\r
Impressum, Datenschutz