aboutsummaryrefslogtreecommitdiff
path: root/src/CoordBase.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/CoordBase.c')
-rw-r--r--src/CoordBase.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/CoordBase.c b/src/CoordBase.c
index 82122d9..eb3c777 100644
--- a/src/CoordBase.c
+++ b/src/CoordBase.c
@@ -211,7 +211,7 @@ CCTK_INT Coord_SystemRegister(CCTK_POINTER_TO_CONST GH, CCTK_INT dim,
CCTK_INT Coord_SystemHandle(CCTK_POINTER_TO_CONST GH, CCTK_STRING systemname)
{
- int *handle_ptr;
+ int *handle_ptr, retval;
const coordbaseGH *GHex;
uHash *hash;
@@ -223,14 +223,20 @@ CCTK_INT Coord_SystemHandle(CCTK_POINTER_TO_CONST GH, CCTK_STRING systemname)
handle_ptr = Util_HashData(hash, strlen(systemname), systemname, 0);
if (!handle_ptr)
{
- *handle_ptr = COORDERROR_NOSYSTEM;
+ retval = COORDERROR_NOSYSTEM;
}
- else if (*handle_ptr<0)
+ else
{
- *handle_ptr = COORDERROR_TABLEERROR;
+ if (*handle_ptr<0)
+ {
+ retval = COORDERROR_TABLEERROR;
+ } else
+ {
+ retval = *handle_ptr;
+ }
}
- return *handle_ptr;
+ return retval;
}
/*@@