From 301bf81931342bb2bc5bff496f58308fcbc64ab6 Mon Sep 17 00:00:00 2001 From: joerg Date: Sun, 10 Dec 1995 15:33:00 +0000 Subject: Check the # of arguments, instead of silently dumping core. --- usr.bin/nice/nice.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'usr.bin/nice') diff --git a/usr.bin/nice/nice.c b/usr.bin/nice/nice.c index 6b905d9..b34a941 100644 --- a/usr.bin/nice/nice.c +++ b/usr.bin/nice/nice.c @@ -64,6 +64,8 @@ main(argc, argv) { int niceness = DEFNICE; + if (argc < 2) + errx(1, "usage: nice [-number] command [arguments]"); if (argv[1][0] == '-') if (argv[1][1] == '-' || isdigit(argv[1][1])) { niceness = atoi(argv[1] + 1); -- cgit v1.1