errors: cmdmain

This commit is contained in:
Philippe Teuwen 2019-04-19 00:42:25 +02:00
parent dcfee8963b
commit 38fc6e2290
4 changed files with 9 additions and 7 deletions

View file

@ -631,8 +631,7 @@ static int CmdHelp(const char *Cmd) {
int CmdFlashMem(const char *Cmd) {
clearCommandBuffer();
CmdsParse(CommandTable, Cmd);
return PM3_SUCCESS;
return CmdsParse(CommandTable, Cmd);
}
#endif

View file

@ -28,17 +28,17 @@ static int CmdRem(const char *Cmd) {
#endif
strftime(buf, sizeof(buf), "%Y-%m-%dT%H:%M:%SZ", ct); // ISO8601
PrintAndLogEx(NORMAL, "%s remark: %s", buf, Cmd);
return 0;
return PM3_SUCCESS;
}
static int CmdQuit(const char *Cmd) {
(void)Cmd; // Cmd is not used so far
return 99;
return PM3_EFATAL;
}
static int CmdRev(const char *Cmd) {
CmdCrc(Cmd);
return 0;
return PM3_SUCCESS;
}
static command_t CommandTable[] = {
@ -67,7 +67,7 @@ static command_t CommandTable[] = {
static int CmdHelp(const char *Cmd) {
(void)Cmd; // Cmd is not used so far
CmdsHelp(CommandTable);
return 0;
return PM3_SUCCESS;
}
//-----------------------------------------------------------------------------

View file

@ -181,8 +181,9 @@ main_loop(char *script_cmds_file, char *script_cmd, bool usb_present) {
if ((!entry) || (strcmp(entry->line, cmd) != 0))
add_history(cmd);
// PrintAndLogEx(NORMAL, "RETVAL: %d\n", ret);
// exit or quit
if (ret == 99)
if (ret == PM3_EFATAL)
break;
}
free(cmd);

View file

@ -421,6 +421,8 @@ typedef struct {
#define PM3_EMALLOC -12
// File error
#define PM3_EFILE -13
// Quit program
#define PM3_EFATAL -99
// CMD_DEVICE_INFO response packet has flags in arg[0], flag definitions: