diff --git a/src/Airports/GenAirports850/elevations.cxx b/src/Airports/GenAirports850/elevations.cxx index 9eac44cd..5607c290 100644 --- a/src/Airports/GenAirports850/elevations.cxx +++ b/src/Airports/GenAirports850/elevations.cxx @@ -47,7 +47,7 @@ double tgAverageElevation( const std::string &root, const string_list elev_src, std::vector points = points_source; // just bail if no work to do - if ( points.size() == 0 ) { + if ( points.empty() ) { return 0.0; } @@ -126,4 +126,4 @@ double tgAverageElevation( const std::string &root, const string_list elev_src, TG_LOG(SG_GENERAL, SG_DEBUG, "Average surface height of point list = " << average); return average; -} \ No newline at end of file +} diff --git a/src/Airports/GenAirports850/main.cxx b/src/Airports/GenAirports850/main.cxx index fb89bb78..d10d0873 100644 --- a/src/Airports/GenAirports850/main.cxx +++ b/src/Airports/GenAirports850/main.cxx @@ -308,6 +308,17 @@ int main(int argc, char **argv) exit(-1); } + // try to figure out which apt.dat version we are reading and bail if version is unsupported + in >> skipeol; + char line[20]; + in.getline(line, 20); + in.close(); + int code = atoi(line); + if (code == 810) { + TG_LOG( SG_GENERAL, SG_ALERT, "ERROR: This version of genapts does not support version 810 apt.dat files." ); + exit(-1); + } + // Create the scheduler Scheduler* scheduler = new Scheduler(input_file, work_dir, elev_src);