From fcb7cf86c6596fdc0e620bd5fc45a6a9ccd47fc4 Mon Sep 17 00:00:00 2001 From: portree_kid Date: Tue, 16 Feb 2021 21:37:18 +0100 Subject: [PATCH] Errormessage for Sched time parse error --- src/Traffic/SchedFlight.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Traffic/SchedFlight.cxx b/src/Traffic/SchedFlight.cxx index 05c995a29..fea76b181 100644 --- a/src/Traffic/SchedFlight.cxx +++ b/src/Traffic/SchedFlight.cxx @@ -184,6 +184,10 @@ time_t FGScheduledFlight::processTimeString(const string& theTime) timeOffsetInDays = 0; } // TODO: verify status of each token. + if (timeCopy.length() < 8) { + SG_LOG( SG_AI, SG_WARN, "Timestring too short. " << theTime << " Defaulted to now" ); + return currTimeDate->get_cur_time(); + } targetHour = atoi(timeCopy.substr(0,2).c_str()); targetMinute = atoi(timeCopy.substr(3,5).c_str()); targetSecond = atoi(timeCopy.substr(6,8).c_str());