Require at least one element of command

This commit is contained in:
Keith Winstein
2012-03-18 02:31:40 -04:00
parent 13bd38aa51
commit 452ff9f992
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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 -- */