From: Alan Cox Date: Sat, 14 Jul 2018 20:59:28 +0000 (+0100) Subject: cp: fix silence when given insufficient arguments X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=6a1df7e4e7bd629e3ef6f9b1ddcc5ffaf8b912da;p=FUZIX.git cp: fix silence when given insufficient arguments --- diff --git a/Applications/util/cp.c b/Applications/util/cp.c index a81c1302..f1b1581b 100644 --- a/Applications/util/cp.c +++ b/Applications/util/cp.c @@ -10,6 +10,7 @@ #include #include #include +#include #include typedef unsigned char BOOL; @@ -47,6 +48,10 @@ int main(int argc, char *argv[]) writes(2, ": not a directory\n"); return 1; } + if (argc < 3) { + writes(2, "cp: destination required\n"); + return 1; + } while (argc-- > 2) { srcname = argv[1]; destname = lastarg;