From 511e4907ed81990e0d03c79f47009f1f6cd8ac67 Mon Sep 17 00:00:00 2001 From: schnetter Date: Fri, 4 Aug 2006 18:18:03 +0000 Subject: Avoid array access out of bounds in the error messages stating that there are not enough grid points. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/RotatingSymmetry180/trunk@34 20f44201-0f4f-0410-9130-e5fc2714a787 --- src/rotatingsymmetry180.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rotatingsymmetry180.c b/src/rotatingsymmetry180.c index fdb69e9..d28b40e 100644 --- a/src/rotatingsymmetry180.c +++ b/src/rotatingsymmetry180.c @@ -334,6 +334,8 @@ int BndRot180VI (cGH const * restrict const cctkGH, } if (iorigin[dir] != data.nghostzones[dir]) { + assert (nvars > 0); + var = 0; CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING, "The group \"%s\" has in the %c-direction %d symmetry points (grid points outside of the symmetry boundary). " "This is not equal to the number of ghost zones, which is %d. " @@ -344,6 +346,7 @@ int BndRot180VI (cGH const * restrict const cctkGH, if (data.gsh[dir] < 2*data.nghostzones[dir] + offset[dir]) { assert (nvars > 0); + var = 0; CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING, "The group \"%s\" has in the %c-direction only %d grid points. " "This is not large enough for a 180 degree rotating symmetry boundary that is %d grid points wide. " -- cgit v1.2.3