summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-03 16:29:40 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-03 16:29:40 +0000
commit624589fcb1ed342c47df0cda41f45f92f19c64f9 (patch)
treee6c6f4ef68ee4cd3b3be066d0cfb046e379c0f3d /util
parent3983dc44f4ff8c1119fe21b30d7f379b5d81a04b (diff)
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>
Diffstat (limited to 'util')
-rw-r--r--util/nvmutil/nvmutil.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index c1ed8cdb..eef4f6df 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -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)