From: marshmellow42 Date: Mon, 25 May 2015 02:31:13 +0000 (-0400) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Tag: v2.1.0~8^2~9 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/e406dd5cc996bc29f0169301d3278fd82bae9cfc?hp=79d7bcbb51db25dab899b3b250f48a0ab40e30e9 Merge remote-tracking branch 'upstream/master' --- diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index aa3b66dc..2b5a5b87 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -1200,9 +1200,9 @@ int CmdHF14AMfELoad(const char *Cmd) len = param_getstr(Cmd,nameParamNo,filename); - if (len > FILE_PATH_SIZE) len = FILE_PATH_SIZE; + if (len > FILE_PATH_SIZE - 4) len = FILE_PATH_SIZE - 4; - fnameptr += len-4; + fnameptr += len; sprintf(fnameptr, ".eml"); @@ -1299,19 +1299,22 @@ int CmdHF14AMfESave(const char *Cmd) len = param_getstr(Cmd,nameParamNo,filename); - if (len > FILE_PATH_SIZE) len = FILE_PATH_SIZE; + if (len > FILE_PATH_SIZE - 4) len = FILE_PATH_SIZE - 4; // user supplied filename? if (len < 1) { // get filename (UID from memory) if (mfEmlGetMem(buf, 0, 1)) { PrintAndLog("Can\'t get UID from block: %d", 0); - sprintf(filename, "dump.eml"); + len = sprintf(fnameptr, "dump"); + fnameptr += len; + } + else { + for (j = 0; j < 7; j++, fnameptr += 2) + sprintf(fnameptr, "%02X", buf[j]); } - for (j = 0; j < 7; j++, fnameptr += 2) - sprintf(fnameptr, "%02X", buf[j]); } else { - fnameptr += len-4; + fnameptr += len; } // add file extension @@ -1572,10 +1575,10 @@ int CmdHF14AMfCLoad(const char *Cmd) return 0; } else { len = strlen(Cmd); - if (len > FILE_PATH_SIZE) len = FILE_PATH_SIZE; + if (len > FILE_PATH_SIZE - 4) len = FILE_PATH_SIZE - 4; memcpy(filename, Cmd, len); - fnameptr += len-4; + fnameptr += len; sprintf(fnameptr, ".eml"); @@ -1741,7 +1744,7 @@ int CmdHF14AMfCSave(const char *Cmd) { return 0; } else { len = strlen(Cmd); - if (len > FILE_PATH_SIZE) len = FILE_PATH_SIZE; + if (len > FILE_PATH_SIZE - 4) len = FILE_PATH_SIZE - 4; if (len < 1) { // get filename