Skip to content

Commit

Permalink
Exit with usage when extra arguments are on command line
Browse files Browse the repository at this point in the history
preventing mistakes such as "halt 0p" for "halt -p".
Approved by:	bde (mentor), phk (mentor)
MFC after:	1 week
  • Loading branch information
rwgbsd committed Apr 5, 2018
1 parent 5f1547e commit 0b35cef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sbin/reboot/reboot.c
Expand Up @@ -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");
Expand Down

0 comments on commit 0b35cef

Please sign in to comment.