4x50_sim: options 'u' and 'f' can not be used at the same time

This commit is contained in:
tharexde 2020-10-28 12:41:28 +01:00
parent 140037d9f0
commit 236e3f82d8

View file

@ -1041,7 +1041,7 @@ int CmdEM4x50Restore(const char *Cmd) {
int CmdEM4x50Sim(const char *Cmd) {
bool errors = false;
bool errors = false, word_given = false;;
uint8_t cmdp = 0;
char filename[FILE_PATH_SIZE] = {0};
@ -1056,6 +1056,7 @@ int CmdEM4x50Sim(const char *Cmd) {
case 'u':
etd.word = param_get32ex(Cmd, cmdp + 1, 0, 16);
word_given = true;
cmdp += 2;
break;
@ -1071,9 +1072,14 @@ int CmdEM4x50Sim(const char *Cmd) {
};
}
// validation
// validations
if (errors)
return usage_lf_em4x50_sim();
if (word_given && (strlen(filename) != 0)) {
PrintAndLogEx(INFO, "Plesae use either option 'u' or option 'f'");
return usage_lf_em4x50_sim();
}
PrintAndLogEx(INFO, "Start simulating");