From 6a1df7e4e7bd629e3ef6f9b1ddcc5ffaf8b912da Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sat, 14 Jul 2018 21:59:28 +0100 Subject: [PATCH] cp: fix silence when given insufficient arguments --- Applications/util/cp.c | 5 +++++ 1 file changed, 5 insertions(+) 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; -- 2.34.1