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