cmdhf15: fix sanity check (uidlen alone is > 1 when -u is set)

This commit is contained in:
Yann GASCUEL committed 2024-01-24 17:33:18 +01:00
1 parent db616ce7bf
commit 472b6a8c64
1 file changed
+3 -3
+3 -3
View File
@@ -936,7 +936,7 @@ static int CmdHF15Info(const char *Cmd) {
CLIParserFree(ctx);
// sanity checks
if ((scan + unaddressed + uidlen) > 1) {
if ((scan + unaddressed + (uidlen > 0)) > 1) {
PrintAndLogEx(WARNING, "Select only one option /scan/unaddress/uid");
return PM3_EINVARG;
}
@@ -1639,7 +1639,7 @@ static int CmdHF15WriteDsfid(const char *Cmd) {
CLIParserFree(ctx);
// sanity checks
if ((scan + unaddressed + uidlen) > 1) {
if ((scan + unaddressed + (uidlen > 0)) > 1) {
PrintAndLogEx(WARNING, "Select only one option /scan/unaddress/uid");
return PM3_EINVARG;
}
@@ -2588,7 +2588,7 @@ static int CmdHF15Restore(const char *Cmd) {
CLIParserFree(ctx);
// sanity checks
if ((scan + unaddressed + uidlen) > 1) {
if ((scan + unaddressed + (uidlen > 0)) > 1) {
PrintAndLogEx(WARNING, "Select only one option /scan/unaddress/uid");
return PM3_EINVARG;
}