BUG: It is possible for the nightly start time to be over 24 hours in the future which requires two days to be subtracted. Using a while loop to make sure enough days are added or subtracted. It should never be able to iterate more than twice.

This commit is contained in:
Brad King 2005-03-30 16:11:37 -05:00
parent 3bb990dcf1
commit a0e71e77f9

View File

@ -79,7 +79,7 @@ struct tm* cmCTest::GetNightlyTime(std::string str,
const int dayLength = 24 * 60 * 60; const int dayLength = 24 * 60 * 60;
//std::cout << "Seconds: " << tctime << std::endl; //std::cout << "Seconds: " << tctime << std::endl;
if ( ntime > tctime ) while ( ntime > tctime )
{ {
// If nightlySeconds is in the past, this is the current // If nightlySeconds is in the past, this is the current
// open dashboard, then return nightlySeconds. If // open dashboard, then return nightlySeconds. If
@ -93,7 +93,7 @@ struct tm* cmCTest::GetNightlyTime(std::string str,
std::cout << " Future time, subtract day: " << ntime << std::endl; std::cout << " Future time, subtract day: " << ntime << std::endl;
} }
} }
if ( tctime > (ntime + dayLength) ) while ( tctime > (ntime + dayLength) )
{ {
ntime += dayLength; ntime += dayLength;
if ( verbose ) if ( verbose )