util/nvmutil: declare arg_cmd earlier

set it after the argc check

i don't like initialising a const after
declaration, but it compiles, and it keeps
with the style used in the rest of the code.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-03 16:29:40 +00:00
parent 3983dc44f4
commit 624589fcb1
+2 -1
View File
@@ -130,13 +130,14 @@ static void
set_cmd(int argc, char *argv[])
{
size_t i;
const char *arg_cmd;
if (argc == 2) {
cmd = cmd_setmac;
return;
}
const char *arg_cmd = argv[2];
arg_cmd = argv[2];
for (i = 0; (i < items(ops)) && (cmd == NULL); i++) {
if (strcmp(arg_cmd, ops[i].str) != 0)