summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nice.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/nice.c b/nice.c
index 94af5f1..f66c416 100644
--- a/nice.c
+++ b/nice.c
@@ -50,6 +50,11 @@ int main(int argc, char *argv[])
}
}
+ if (optind >= argc) {
+ fprintf(stderr, "nice: missing operand\n");
+ return 1;
+ }
+
errno = 0;
if (nice(increment) == -1 && errno != 0) {
perror("nice");