aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Boundary.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Boundary.c b/src/Boundary.c
index d9da8a3..5d2f7b3 100644
--- a/src/Boundary.c
+++ b/src/Boundary.c
@@ -895,7 +895,7 @@ CCTK_INT Bdry_Boundary_SelectedGVs(CCTK_POINTER_TO_CONST _GH,
CCTK_INT *table_handles,
CCTK_STRING bc_name)
{
- int retval, i;
+ int retval, i, j;
struct BCVAR *current;
struct BCDATA *current_bcdata;
const cGH *GH = _GH;
@@ -922,6 +922,8 @@ CCTK_INT Bdry_Boundary_SelectedGVs(CCTK_POINTER_TO_CONST _GH,
bc_name, array_size); fflush(stdout);
#endif
+ i = 0; /* i indexes the location in the returned arrays */
+
/* Step through bcdata list */
for (current_bcdata = bcdata_list;
current_bcdata;
@@ -940,7 +942,7 @@ CCTK_INT Bdry_Boundary_SelectedGVs(CCTK_POINTER_TO_CONST _GH,
current = current_bcdata->var_list;
/* Loop through var list */
- for (i=0; /* i indexes the location in the returned arrays */
+ for (j=0; /* j counts the bcs to check internal consistency */
i<array_size && current;
current = current->next, ++i)
{
@@ -968,6 +970,8 @@ CCTK_INT Bdry_Boundary_SelectedGVs(CCTK_POINTER_TO_CONST _GH,
((int *) var_indices)[i] = current->var;
}
}
+ if (j > current_bcdata->num) CCTK_WARN (0, "internal error");
+ if (i != array_size && j != current_bcdata->num) CCTK_WARN (0, "internal error");
}
}