aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2003-07-31 17:37:36 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2003-07-31 17:37:36 +0000
commitcb19d5b52db5530a949aeeae09dbcf6f2f081c51 (patch)
treefd965c0060fba1232a65f7fced6339e3d8a4a8ee /src
parent4cdea23215684e816418bf7499933d3844ede43c (diff)
do nothing gracefully if N_horizons is set to 0
(previously we core-dumped -- thanks to Ian Hawke for spotting this!) git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@1171 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src')
-rw-r--r--src/driver/setup.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/driver/setup.cc b/src/driver/setup.cc
index 1e4cc9e..dfd0d5e 100644
--- a/src/driver/setup.cc
+++ b/src/driver/setup.cc
@@ -345,12 +345,13 @@ state.N_active_procs
// horizon numbers run from 1 to N_horizons inclusive
// so the array size is N_horizons+1
state.AH_data_array = (N_horizons == 0) ? NULL : new AH_data*[N_horizons+1];
- {
- for (int hn = 0 ; hn <= N_horizons ; ++hn)
- {
- state.AH_data_array[hn] = NULL;
+if (N_horizons > 0)
+ then {
+ for (int hn = 0 ; hn <= N_horizons ; ++hn)
+ {
+ state.AH_data_array[hn] = NULL;
+ }
}
- }
//