Require at least one element of command
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@ mosh-server \- server-side helper for mosh
|
||||
.B mosh-server
|
||||
[IP address to bind]
|
||||
[port number to bind]
|
||||
[-- command command2 ...]
|
||||
[-- command...]
|
||||
.br
|
||||
.SH DESCRIPTION
|
||||
\fBmosh-server\fP is a helper program for the
|
||||
|
||||
@@ -74,7 +74,7 @@ int main( int argc, char *argv[] )
|
||||
char **command = NULL;
|
||||
|
||||
/* Look for command */
|
||||
for ( int i = 0; i < argc; i++ ) {
|
||||
for ( int i = 0; i < argc - 1; i++ ) {
|
||||
if ( 0 == strcmp( argv[ i ], "--" ) ) { /* start of command */
|
||||
command = argv + i + 1;
|
||||
argc = i; /* rest of options before -- */
|
||||
|
||||
Reference in New Issue
Block a user