(main): detect the case of no command given.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6176 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-05-09 11:43:44 +00:00
parent 28babc7bcf
commit 489626c62e

View File

@@ -416,6 +416,11 @@ proto (int s, int errsock,
return loop (s, errsock2);
}
/*
* Return in `res' a copy of the concatenation of `argc, argv' into
* malloced space.
*/
static size_t
construct_command (char **res, int argc, char **argv)
{
@@ -625,7 +630,7 @@ usage (int ret)
}
/*
* main
*
*/
int
@@ -690,6 +695,9 @@ main(int argc, char **argv)
host = argv[host_index = optind++];
}
if (optind == argc)
errx (1, "no command given. Try rlogin if that's what you wanted.");
if (port_str) {
struct servent *s = roken_getservbyname (port_str, "tcp");