From 422b3b747344ac32e759e2e9b0975d34acc57399 Mon Sep 17 00:00:00 2001 From: "Peter S. Hollander" Date: Tue, 24 Mar 2026 10:53:13 +0000 Subject: [PATCH] Preserve default flow --- client/src/cmdhf15.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/client/src/cmdhf15.c b/client/src/cmdhf15.c index a5b73b93f..becd9f7fd 100644 --- a/client/src/cmdhf15.c +++ b/client/src/cmdhf15.c @@ -1473,7 +1473,7 @@ static int CmdHF15Sim(const char *Cmd) { arg_param_begin, arg_str0("u", "uid", "", "UID, 8 hex bytes"), arg_int0("b", "blocksize", "", "block size (def 4)"), - arg_int0("t", "timeout", "", "timeout in ms (0 will run until button press - def 0)"), + arg_int0("t", "timeout", "", "timeout in ms (def -1, ie. until button press)"), arg_param_end }; CLIExecWithReturn(ctx, Cmd, argtable, true); @@ -1487,7 +1487,7 @@ static int CmdHF15Sim(const char *Cmd) { int uidlen = 0; CLIGetHexWithReturn(ctx, 1, payload.uid, &uidlen); payload.block_size = arg_get_int_def(ctx, 2, 4); - size_t timeout = arg_get_int_def(ctx, 3, 0); + size_t timeout = arg_get_int_def(ctx, 3, -1); CLIParserFree(ctx); // sanity checks @@ -1496,10 +1496,6 @@ static int CmdHF15Sim(const char *Cmd) { return PM3_EINVARG; } - if (timeout == 0) { - timeout = -1; - } - PacketResponseNG resp; // get UID from emulator for printing @@ -1532,7 +1528,7 @@ static int CmdHF15Sim(const char *Cmd) { clearCommandBuffer(); SendCommandNG(CMD_HF_ISO15693_SIMULATE, (uint8_t *)&payload, sizeof(payload)); WaitForResponseTimeout(CMD_HF_ISO15693_SIMULATE, &resp, timeout); - if (timeout != -1) { + if (timeout != (size_t) - 1) { SendCommandNG(CMD_BREAK_LOOP, NULL, 0); } PrintAndLogEx(INFO, "Done!");