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>
btrfsvols
Leah Rowe 2023-09-18 16:48:26 +01:00
parent 0897a0be17
commit 4d44820163
1 changed files with 2 additions and 1 deletions

View File

@ -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__