diff options
Diffstat (limited to 'src/StaticBoundary.c')
-rw-r--r-- | src/StaticBoundary.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/StaticBoundary.c b/src/StaticBoundary.c index b1b0f3d..e4615b3 100644 --- a/src/StaticBoundary.c +++ b/src/StaticBoundary.c @@ -133,13 +133,9 @@ int BndStatic(const cGH *GH, int num_vars, int *vars, int *faces, int *widths, /* Determine boundary width on all faces */ /* allocate memory for buffer */ gdim = CCTK_GroupDimI(gi); - if (!width_alldirs) + if (gdim > max_gdim) { - width_alldirs = (int *) malloc(2*gdim*sizeof(int)); - max_gdim = gdim; - } else if (gdim > max_gdim) - { - width_alldirs = realloc(width_alldirs, gdim*sizeof(int)); + width_alldirs = realloc(width_alldirs, 2*gdim*sizeof(int)); max_gdim = gdim; } |