]> git.mxchange.org Git - flightgear.git/commitdiff
Nick "Lethe" WARNE: prevent crash caused by improper use of --multiplay
authormfranz <mfranz>
Wed, 25 Jul 2007 15:17:06 +0000 (15:17 +0000)
committermfranz <mfranz>
Wed, 25 Jul 2007 15:17:06 +0000 (15:17 +0000)
mf: stripped down the log message a bit :-)

src/Main/fg_io.cxx

index 134087885203e16ab1a6ff840a5394811d632932..82bcfeb35459a04dd48c1082d04feaae3dcbb6f6 100644 (file)
@@ -187,8 +187,12 @@ FGIO::parse_port_config( const string& config )
             else if (tokens[1] == "file") n--;
             FGGeneric *generic = new FGGeneric( tokens[n] );
             io = generic;
-       } else if ( protocol == "multiplay" ) {\
-           //Determine dir, rate, host & port
+       } else if ( protocol == "multiplay" ) {
+           if ( tokens.size() != 5 ) {
+               SG_LOG( SG_IO, SG_ALERT, "Ignoring invalid --multiplay option "
+                       "(4 arguments expected: --multiplay=dir,hz,hostname,port)" );
+               return NULL;
+           }
            string dir = tokens[1];
            string rate = tokens[2];
            string host = tokens[3];