From: Andrew Tridgell Date: Sat, 16 May 1998 15:18:07 +0000 (+0000) Subject: check for right number of arguments _after_ the option parsing. X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/6c0034684984953b4078759e6c1843ac50496f36 check for right number of arguments _after_ the option parsing. this stops "rsync -v" causing a segv. --- diff --git a/main.c b/main.c index 0a57af63..f557e552 100644 --- a/main.c +++ b/main.c @@ -492,6 +492,11 @@ int main(int argc,char *argv[]) argv += optind; optind = 0; + if (argc < 1) { + usage(FERROR); + exit(1); + } + signal(SIGCHLD,SIG_IGN); signal(SIGINT,SIGNAL_CAST sig_int); signal(SIGPIPE,SIGNAL_CAST sig_int);