From: Andrew Tridgell Date: Wed, 13 May 1998 07:04:40 +0000 (+0000) Subject: check argc and show usage if no args X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/df5e03da7b1c81d014388b7aa0ac764b97e9dee2 check argc and show usage if no args --- diff --git a/main.c b/main.c index ea7622ad..b4c514fd 100644 --- a/main.c +++ b/main.c @@ -494,6 +494,11 @@ int main(int argc,char *argv[]) starttime = time(NULL); am_root = (getuid() == 0); + if (argc < 2) { + usage(FERROR); + exit(1); + } + /* we set a 0 umask so that correct file permissions can be carried across */ orig_umask = (int)umask(0);