mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-01 02:03:31 +00:00
Check the # of arguments, instead of silently dumping core.
This commit is contained in:
parent
279884182f
commit
54e66fcad5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12729
@ -64,6 +64,8 @@ main(argc, argv)
|
|||||||
{
|
{
|
||||||
int niceness = DEFNICE;
|
int niceness = DEFNICE;
|
||||||
|
|
||||||
|
if (argc < 2)
|
||||||
|
errx(1, "usage: nice [-number] command [arguments]");
|
||||||
if (argv[1][0] == '-')
|
if (argv[1][0] == '-')
|
||||||
if (argv[1][1] == '-' || isdigit(argv[1][1])) {
|
if (argv[1][1] == '-' || isdigit(argv[1][1])) {
|
||||||
niceness = atoi(argv[1] + 1);
|
niceness = atoi(argv[1] + 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user