diff options
author | Leah Rowe <leah@libreboot.org> | 2023-09-18 16:48:26 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2023-09-18 16:48:26 +0100 |
commit | 4d4482016368614b2187727489d7508dbdc94309 (patch) | |
tree | 9f35ac089f0f260ee3d738f02760ee375d9ac5fb | |
parent | 0897a0be1720aceb04e0b62da23933d10767b585 (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>
-rw-r--r-- | util/nvmutil/nvmutil.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 290808d3..55d7e5f6 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__ |