Do not create empty dump files

This commit is contained in:
iceman1001 2022-08-02 22:49:25 +02:00
parent fe45cdd605
commit 88d45d641c

View file

@ -1952,6 +1952,11 @@ int pm3_load_dump(const char *fn, void **pdump, size_t *dumplen, size_t maxdumpl
}
int pm3_save_dump(const char *fn, uint8_t *d, size_t n, JSONFileType jsft, size_t blocksize) {
if (n == 0) {
PrintAndLogEx(INFO, "No data to save. Skipping...");
return PM3_EINVARG;
}
saveFile(fn, ".bin", d, n);
saveFileEML(fn, d, n, blocksize);
saveFileJSON(fn, jsft, d, n, NULL);