From a0e71e77f917b2ddef312a1b9043af1b31558b3c Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 30 Mar 2005 16:11:37 -0500 Subject: [PATCH] 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. --- Source/cmCTest.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index a7fc62cbc..e8e16a2cc 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -79,7 +79,7 @@ struct tm* cmCTest::GetNightlyTime(std::string str, const int dayLength = 24 * 60 * 60; //std::cout << "Seconds: " << tctime << std::endl; - if ( ntime > tctime ) + while ( ntime > tctime ) { // If nightlySeconds is in the past, this is the current // 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; } } - if ( tctime > (ntime + dayLength) ) + while ( tctime > (ntime + dayLength) ) { ntime += dayLength; if ( verbose )