summaryrefslogtreecommitdiff
path: root/util/nvmutil
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-09-18 16:48:26 +0100
committerLeah Rowe <leah@libreboot.org>2023-09-18 16:48:26 +0100
commit4d4482016368614b2187727489d7508dbdc94309 (patch)
tree9f35ac089f0f260ee3d738f02760ee375d9ac5fb /util/nvmutil
parent0897a0be1720aceb04e0b62da23933d10767b585 (diff)
util/nvmutil: don't use err_if on argc check
at this stage in the code, the file name will be NULL value, so it would be improper to use it in a string. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil')
-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 290808d..55d7e5f 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -73,7 +73,8 @@ void (*cmd)(void) = NULL;
int
main(int argc, char *argv[])
{
- err_if((errno = argc < 3 ? EINVAL : errno));
+ if (argc < 3)
+ err(errno = ECANCELED, "Too few arguments");
flags = (strcmp(COMMAND, "dump") == 0) ? O_RDONLY : flags;
filename = argv[1];
#ifdef __OpenBSD__