diff options
author | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2003-02-27 14:26:00 +0000 |
---|---|---|
committer | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2003-02-27 14:26:00 +0000 |
commit | b321a95d25c8a6761c878fa3f12275c530bd2430 (patch) | |
tree | f4ecc300a2cbd8cbc0a6e15f9fd4d2107ce0b6b2 /src/main/Parameters.c | |
parent | 36b52a34265286c5c62c66f101df7427b1027e15 (diff) |
Bug fix for CCTK_ParameterWalk() which caused an infinite loop when called
from HTTPD.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@3155 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/Parameters.c')
-rw-r--r-- | src/main/Parameters.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/Parameters.c b/src/main/Parameters.c index 28e1529e..39cefde8 100644 --- a/src/main/Parameters.c +++ b/src/main/Parameters.c @@ -968,6 +968,13 @@ int CCTK_ParameterWalk (int first, /* save the last startpoint */ prev_startpoint_all = prev_startpoint_thorn = startpoint; + /* advance to the next if this is an array parameter */ + if (startpoint->props->array_size > 0) + { + startpoint = &startpoint->array[next_index++]; + } + + /* set the parameter's fullname if requested by the caller */ if (pfullname) { prefix = startpoint->props->thorn; @@ -976,10 +983,6 @@ int CCTK_ParameterWalk (int first, prefix = CCTK_ThornImplementation (prefix); } - if (startpoint->props->array_size > 0) - { - startpoint = &startpoint->array[next_index++]; - } *pfullname = malloc (strlen (prefix) + strlen (startpoint->props->name) + 3); if(*pfullname) |