util/nvmutil: fix faulty arg check

in practise, no other condition would be met and the
program still worked. this is a pre-emptive fix.
This commit is contained in:
Leah Rowe
2023-06-03 15:08:29 +01:00
parent 270693fc92
commit dbd6defe9a
+1 -1
View File
@@ -9,7 +9,7 @@ main(int argc, char *argv[])
xpledge("stdio rpath wpath unveil", NULL);
for (int i = 0; i < 6; i++)
if (strcmp(COMMAND, op[i].str) == 0)
if (!(cmd = argc >= op[i].args ? op[i].cmd : NULL))
if ((cmd = argc >= op[i].args ? op[i].cmd : NULL))
break;
if (cmd == cmd_setmac)
strMac = (argc > 3) ? MAC_ADDRESS : strRMac;