mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-05-12 11:18:11 -07:00
added a zero check for data save
This commit is contained in:
@@ -2235,7 +2235,7 @@ int CmdSave(const char *Cmd) {
|
||||
|
||||
CLIParserContext *ctx;
|
||||
CLIParserInit(&ctx, "data save",
|
||||
"Save trace from graph window , i.e. the GraphBuffer\n"
|
||||
"Save signal trace from graph window , i.e. the GraphBuffer\n"
|
||||
"This is a text file with number -127 to 127. With the option `w` you can save it as wave file\n"
|
||||
"Filename should be without file extension",
|
||||
"data save -f myfilename -> save graph buffer to file\n"
|
||||
@@ -2256,9 +2256,13 @@ int CmdSave(const char *Cmd) {
|
||||
char filename[FILE_PATH_SIZE] = {0};
|
||||
// CLIGetStrWithReturn(ctx, 2, (uint8_t *)filename, &fnlen);
|
||||
CLIParamStrToBuf(arg_get_str(ctx, 2), (uint8_t *)filename, FILE_PATH_SIZE, &fnlen);
|
||||
|
||||
CLIParserFree(ctx);
|
||||
|
||||
if (g_GraphTraceLen == 0) {
|
||||
PrintAndLogEx(WARNING, "Graphbuffer is empty, nothing to save");
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
if (as_wave)
|
||||
return saveFileWAVE(filename, g_GraphBuffer, g_GraphTraceLen);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user