mirror of
https://github.com/opnsense/src.git
synced 2026-06-13 18:50:31 -04:00
Exit with usage when extra arguments are on command line
preventing mistakes such as "halt 0p" for "halt -p". Approved by: bde (mentor), phk (mentor) MFC after: 1 week
This commit is contained in:
parent
9dba82a442
commit
2e23ded5c4
1 changed files with 2 additions and 0 deletions
|
|
@ -116,6 +116,8 @@ main(int argc, char *argv[])
|
|||
}
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
if (argc != 0)
|
||||
usage();
|
||||
|
||||
if ((howto & (RB_DUMP | RB_HALT)) == (RB_DUMP | RB_HALT))
|
||||
errx(1, "cannot dump (-d) when halting; must reboot instead");
|
||||
|
|
|
|||
Loading…
Reference in a new issue