From cbc048b8010347dcbc3a46186e8d4ff94c29d668 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Sun, 10 Jul 2011 12:52:45 +0200 Subject: [PATCH] Fix minor DME frequency issue. DME frequency value should be double - not string. --- src/Main/options.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; } -- 2.39.5