diff options
author | schnetter <schnetter@082bdb00-0f4f-0410-b49e-b1835e5f2039> | 2006-08-23 00:58:04 +0000 |
---|---|---|
committer | schnetter <schnetter@082bdb00-0f4f-0410-b49e-b1835e5f2039> | 2006-08-23 00:58:04 +0000 |
commit | 5352835c7e20ebf5fb6d5bcbfe4d4f310bd5bc9d (patch) | |
tree | 6ef8feca6131a3b16962cd91a50fc03e7a9415d1 | |
parent | 5a8ce52b66b414734ac739d294efa201e2b19599 (diff) |
Handle the case of 0 interpolation points correctly. malloc can
return NULL in this case.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/ReflectionSymmetry/trunk@16 082bdb00-0f4f-0410-b49e-b1835e5f2039
-rw-r--r-- | src/apply.c | 6 | ||||
-rw-r--r-- | src/interpolate.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/apply.c b/src/apply.c index 20f8993..6170234 100644 --- a/src/apply.c +++ b/src/apply.c @@ -591,6 +591,12 @@ ReflectionSymmetry_Apply (CCTK_ARGUMENTS) CCTK_WARN (0, "Internal error in Boundary_SelectedGVs"); } + if (nvars == 0) + { + /* Nothing to do */ + return; + } + indices = malloc (nvars * sizeof *indices); if (! indices) { diff --git a/src/interpolate.c b/src/interpolate.c index 9d52c9a..884abe6 100644 --- a/src/interpolate.c +++ b/src/interpolate.c @@ -88,7 +88,7 @@ ReflectionSymmetry_Interpolate (CCTK_POINTER_TO_CONST restrict const cctkGH_, { new_interp_coords[dir] = malloc (N_interp_points * sizeof (CCTK_REAL)); - assert (new_interp_coords[dir]); + assert (N_interp_points == 0 || new_interp_coords[dir]); for (n=0; n<N_interp_points; ++n) { |