From 6ea7503e686ed7e26af79af73f4284ea59396a97 Mon Sep 17 00:00:00 2001 From: tradke Date: Fri, 17 Jan 2003 10:29:35 +0000 Subject: 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 --- src/IsoSurfacerInit.c | 16 ++++++++++------ 1 file 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 '.' */ -- cgit v1.2.3