From b0bb63bf79debf3eb48fd4b21e65a2e9685f82fd Mon Sep 17 00:00:00 2001 From: mfranz Date: Wed, 25 Jul 2007 15:17:06 +0000 Subject: [PATCH] Nick "Lethe" WARNE: prevent crash caused by improper use of --multiplay mf: stripped down the log message a bit :-) --- src/Main/fg_io.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Main/fg_io.cxx b/src/Main/fg_io.cxx index 134087885..82bcfeb35 100644 --- a/src/Main/fg_io.cxx +++ b/src/Main/fg_io.cxx @@ -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]; -- 2.39.5