From 54e66fcad5eae44880f740926ada45607ffaeef6 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Sun, 10 Dec 1995 15:33:00 +0000 Subject: [PATCH] Check the # of arguments, instead of silently dumping core. --- usr.bin/nice/nice.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.bin/nice/nice.c b/usr.bin/nice/nice.c index 6b905d9879d..b34a9416a1a 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);