summaryrefslogtreecommitdiff
path: root/src/main/GroupsOnGH.c
diff options
context:
space:
mode:
authorlanfer <lanfer@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-07-29 18:58:00 +0000
committerlanfer <lanfer@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-07-29 18:58:00 +0000
commit974e9ebf2bd8a202b15e4507b9bcfae1223b23aa (patch)
treea7acd313332d31ea51b7df9c31868b74c8cee209 /src/main/GroupsOnGH.c
parentda3d0490a93e047d87f37891ba5c14939ddfdd95 (diff)
A check for a valid index
git-svn-id: http://svn.cactuscode.org/flesh/trunk@821 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/GroupsOnGH.c')
-rw-r--r--src/main/GroupsOnGH.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/GroupsOnGH.c b/src/main/GroupsOnGH.c
index ac0d1401..0a63fb7d 100644
--- a/src/main/GroupsOnGH.c
+++ b/src/main/GroupsOnGH.c
@@ -97,7 +97,7 @@ void *CCTK_VarDataPtr(cGH *GH, int timelevel, char *fullvarname)
@enddesc
@calls
@history
-
+ A check for a valid index (i>=0) included by Gerd Lanfermann
@endhistory
@var GH
@@ -130,7 +130,9 @@ void *CCTK_VarDataPtr(cGH *GH, int timelevel, char *fullvarname)
@@*/
void *CCTK_VarDataPtrI(cGH *GH, int timelevel, int varindex)
-{
+{
+ if (varindex < 0)
+ CCTK_WARN(1,"WARNING: calling CCTK_VarDataPtrI with negative index! Prob. Fatal");
return GH->data[varindex][timelevel];
}