From 99faa32c501ebb610aa7d40e55b714272bb785d8 Mon Sep 17 00:00:00 2001 From: tradke Date: Tue, 30 Oct 2001 13:58:04 +0000 Subject: Fixed const pointer issue in the advertised file structure. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOBasic/trunk@104 b589c3ab-70e8-4b4d-a09f-cba2dd200880 --- src/WriteScalar.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/WriteScalar.c b/src/WriteScalar.c index 8528bb8..981f30e 100644 --- a/src/WriteScalar.c +++ b/src/WriteScalar.c @@ -334,13 +334,16 @@ static FILE *OpenScalarFile (cGH *GH, char comment_char, buffer[128]; ioAdvertisedFileDesc advertised_file; iobasicGH *myGH; - char *openmode; + char *openmode, *fullname; struct stat fileinfo; /* get the GH extension handle for IOBasic */ myGH = (iobasicGH *) CCTK_GHExtension (GH, "IOBasic"); + /* get the variable's full name */ + fullname = CCTK_FullName (vindex); + /* see if output files for this alias name were already created */ if (GetNamedData (myGH->filenameListScalar, filename) == NULL) { @@ -375,10 +378,10 @@ static FILE *OpenScalarFile (cGH *GH, StoreNamedData (&myGH->filenameListScalar, filename, (void *) 1); /* advertise the file for downloading */ - advertised_file.slice = strdup (slicename); + advertised_file.slice = slicename; advertised_file.thorn = CCTK_THORNSTRING; - advertised_file.varname = CCTK_FullName (vindex); - advertised_file.description = strdup (description); + advertised_file.varname = fullname; + advertised_file.description = description; IOUtil_AdvertiseFile (GH, filename, &advertised_file); @@ -407,9 +410,7 @@ static FILE *OpenScalarFile (cGH *GH, } fprintf (file, "%c%s v time\n", comment_char, aliasname); - free (advertised_file.description); - free (advertised_file.varname); - free (advertised_file.slice); + free (fullname); } return (file); -- cgit v1.2.3