logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git
commit: 1571514d4ca067ce9e42072cb5173e83b39be700
parent fae6a89ddb02a54da798899cd915a15570b3662d
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Fri, 27 Sep 2024 02:33:07 +0200

cmd/join: error message when argc != 2

Diffstat:

Mcmd/join.c6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/cmd/join.c b/cmd/join.c @@ -204,7 +204,11 @@ main(int argc, char *argv[]) if(aflag && vflag) errx(1, "error: the -a and -v options are mutually exclusive"); - if(argc != 2) usage(); + if(argc != 2) + { + fprintf(stderr, "%s: error: Need exactly 2 file operands, got %d instead\n", argv0, argc); + usage(); + } /* Open the files; "-" means stdin. */ if(!strcmp(*argv, "-"))