diff options
author | tradke <tradke@1faa4e14-9dd3-4be0-9f0e-ffe519881164> | 2001-11-05 18:51:41 +0000 |
---|---|---|
committer | tradke <tradke@1faa4e14-9dd3-4be0-9f0e-ffe519881164> | 2001-11-05 18:51:41 +0000 |
commit | 2a662d5df8bfdcaffa0334589b811a6170832b6a (patch) | |
tree | fad00c744d0dda8420b9925288850feafc74a16a | |
parent | 64783aa042ccb906c1bd2d8394fc64278b0aea2b (diff) |
Fixed a division by zero when printing the runtime at cctk_iteration == 0.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@135 1faa4e14-9dd3-4be0-9f0e-ffe519881164
-rw-r--r-- | src/Content.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Content.c b/src/Content.c index 517202f..4f7526d 100644 --- a/src/Content.c +++ b/src/Content.c @@ -511,15 +511,18 @@ static int MainPage(cGH *cctkGH, httpRequest *request, void *data) strcpy(message,"<li>Estimated time to completion:<UL> "); - if (cctk_final_time<cctk_initial_time) + if (cctk_final_time < cctk_initial_time) { - seconds = (cctk_itlast-cctkGH->cctk_iteration)*CCTK_RunTime()/ - cctkGH->cctk_iteration; + seconds = cctk_itlast - cctkGH->cctk_iteration; } else { - seconds = (cctk_final_time-cctkGH->cctk_time)/cctkGH->cctk_delta_time* - CCTK_RunTime()/cctkGH->cctk_iteration; + seconds = (cctk_final_time - cctkGH->cctk_time) / cctkGH->cctk_delta_time; + } + seconds *= CCTK_RunTime(); + if (cctkGH->cctk_iteration) + { + seconds /= cctkGH->cctk_iteration; } minutes = seconds/60; |