aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/SetupPGH.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/SetupPGH.c b/src/SetupPGH.c
index b14088e..8a6882b 100644
--- a/src/SetupPGH.c
+++ b/src/SetupPGH.c
@@ -219,10 +219,7 @@ void PUGH_DestroyPGH (pGH **GHin)
pGH *GH;
pGA *GA;
cGroup pgroup;
- int i;
- int variable;
- int group;
- int this_var;
+ int i, group, numgroups, this_var, variable;
GH = *GHin;
@@ -244,7 +241,8 @@ void PUGH_DestroyPGH (pGH **GHin)
/* Great. Now go about the work of destroying me. */
variable = 0;
- for (group = CCTK_NumGroups () - 1; group >= 0; group--)
+ numgroups = CCTK_NumGroups ();
+ for (group = 0; group < numgroups; group++)
{
#ifdef DEBUG_PUGH
printf ("Calling Destroying Group %s\n", CCTK_GroupName (group));