From: ThorstenB Date: Sun, 10 Jul 2011 10:52:45 +0000 (+0200) Subject: Fix minor DME frequency issue. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cbc048b8010347dcbc3a46186e8d4ff94c29d668;p=flightgear.git Fix minor DME frequency issue. DME frequency value should be double - not string. --- diff --git a/src/Main/options.cxx b/src/Main/options.cxx index ff306e6d9..9e1b5c55b 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -1132,10 +1132,16 @@ fgOptDME( const char *arg ) fgSetString("/instrumentation/dme/frequencies/source", "/instrumentation/nav[1]/frequencies/selected-mhz"); } else { + double frequency = atof(arg); + if (frequency==0.0) + { + SG_LOG(SG_INPUT, SG_ALERT, "Invalid DME frequency: '" << arg << "'."); + return FG_OPTIONS_ERROR; + } fgSetInt("/instrumentation/dme/switch-position", 2); fgSetString("/instrumentation/dme/frequencies/source", "/instrumentation/dme/frequencies/selected-mhz"); - fgSetString("/instrumentation/dme/frequencies/selected-mhz", arg); + fgSetDouble("/instrumentation/dme/frequencies/selected-mhz", frequency); } return FG_OPTIONS_OK; }