From 462d4af3ebab1adcf85df085b0e39e6ad12f77f9 Mon Sep 17 00:00:00 2001 From: Emil Tsalapatis Date: Wed, 20 Sep 2023 11:45:57 -0400 Subject: [PATCH] clarify that bin/cat only takes one argument --- bin/cat/cat.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/cat/cat.c b/bin/cat/cat.c index 2042070..29e80e9 100644 --- a/bin/cat/cat.c +++ b/bin/cat/cat.c @@ -17,11 +17,16 @@ main(int argc, const char *argv[]) struct stat sb; char buf[256]; - if (argc != 2) { + if (argc < 2) { fputs("Requires an argument\n", stdout); return 1; } + if (argc > 2) { + fputs("Too many arguments, expected one\n", stdout); + return 1; + } + status = OSStat(argv[1], &sb); if (status != 0) { fputs("Cannot stat file\n", stdout);