(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:
@@ -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");
|
||||
|
||||
|
Reference in New Issue
Block a user