diff options
author | tradke <tradke@bfcf8e34-485d-4d46-a995-1fd6fa6fb178> | 2003-01-17 10:29:35 +0000 |
---|---|---|
committer | tradke <tradke@bfcf8e34-485d-4d46-a995-1fd6fa6fb178> | 2003-01-17 10:29:35 +0000 |
commit | 6ea7503e686ed7e26af79af73f4284ea59396a97 (patch) | |
tree | e03c80fe07297f8304e88a1d15fe7019334840a4 | |
parent | ccf922c9ec1280860724d1b09dcf74d340621e98 (diff) |
Copy pointer to string parameter into local variable before modifying it.
This fixes a problem when modifying the string parameter pointer which is
read-only now.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IsoSurfacer/trunk@67 bfcf8e34-485d-4d46-a995-1fd6fa6fb178
-rw-r--r-- | src/IsoSurfacerInit.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/IsoSurfacerInit.c b/src/IsoSurfacerInit.c index 97bd915..ee48974 100644 --- a/src/IsoSurfacerInit.c +++ b/src/IsoSurfacerInit.c @@ -47,7 +47,9 @@ void *IsoSurfacer_SetupGH (tFleshConfig *config, return myGH; } -int IsoSurfacer_InitGH (cGH *GH){ +int IsoSurfacer_InitGH (cGH *GH) +{ + const char *my_out_dir; DECLARE_CCTK_PARAMETERS /* The above string declares the following parameters @@ -108,24 +110,26 @@ int IsoSurfacer_InitGH (cGH *GH){ myGH->RunIsoSurfacer = 1; /* get the name for IsoSurfacer output directory and make sure it exists */ - if (*out_dir) + my_out_dir = out_dir; + if (*my_out_dir) { - i = IOUtil_CreateDirectory (GH, out_dir, 0, 0); + i = IOUtil_CreateDirectory (GH, my_out_dir, 0, 0); if (i < 0) { CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, - "Problem creating IsoSurfacer output directory '%s'",out_dir); + "Problem creating IsoSurfacer output directory '%s'", + my_out_dir); } } else { - out_dir = io_out_dir; + my_out_dir = io_out_dir; i = 0; } if (i >= 0 && CCTK_Equals (verbose, "full")) { CCTK_VInfo (CCTK_THORNSTRING, "IsoSurfacer: Output to directory '%s'", - out_dir); + my_out_dir); } Iso_SetupServer(GH,myGH,dataport,controlport, 5, 1); /* needs to move into InitGH */ /* otherwise, the outdir need not be created if it is '.' */ |