summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-03 15:47:01 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-03 15:47:01 +0000
commit9f12aa3b91a58a6bc45944d50c473d351730caac (patch)
treeb8478261b4112bd7397e0f61ac35b4c4bff2c026 /util
parent572b7758cf695a526ac2e85aa6f9f0e0c575fde6 (diff)
util/nvmutil: tidy up final cmd check in set_cmd
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util')
-rw-r--r--util/nvmutil/nvmutil.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 73527723..f2f3fdbc 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -159,7 +159,9 @@ set_cmd(int argc, char *argv[])
err_if((errno = (!((part = PARTN[0] - '0') == 0 || part == 1))
|| PARTN[1] ? EINVAL : errno)); /* only allow '0' or '1' */
}
- err_if((errno = (cmd == NULL) ? EINVAL : errno));
+
+ if (cmd == NULL)
+ err(set_err(EINVAL), "Bad command");
}
static void