From c94e08337c9c95ed338365aba0db878fa9d5d52f Mon Sep 17 00:00:00 2001 From: schnetter <> Date: Sat, 7 Feb 2004 15:34:00 +0000 Subject: FlexIO string attributes seem to need space for the trailing nul character. darcs-hash:20040207153417-07bb3-d093562a97823a3daff6d01c62b947f27d7acfe9.gz --- CarpetAttic/CarpetIOFlexIO/src/ioflexio.cc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'CarpetAttic') diff --git a/CarpetAttic/CarpetIOFlexIO/src/ioflexio.cc b/CarpetAttic/CarpetIOFlexIO/src/ioflexio.cc index 207fd3f49..4529c1fb8 100644 --- a/CarpetAttic/CarpetIOFlexIO/src/ioflexio.cc +++ b/CarpetAttic/CarpetIOFlexIO/src/ioflexio.cc @@ -15,7 +15,7 @@ #include "cctk_Parameters.h" extern "C" { - static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/CarpetIOFlexIO/src/ioflexio.cc,v 1.40 2004/02/07 16:21:56 schnetter Exp $"; + static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/CarpetIOFlexIO/src/ioflexio.cc,v 1.41 2004/02/07 16:34:17 schnetter Exp $"; CCTK_FILEVERSION(Carpet_CarpetIOFlexIO_ioflexio_cc); } @@ -353,7 +353,19 @@ namespace CarpetIOFlexIO { WriteAttribute (writer, "group_groupname", groupname); free (groupname); } - WriteAttribute (writer, "group_grouptype", grouptype); + switch (grouptype) { + case CCTK_GF: + WriteAttribute (writer, "group_grouptype", "GF"); + break; + case CCTK_ARRAY: + WriteAttribute (writer, "group_grouptype", "ARRAY"); + break; + case CCTK_SCALAR: + WriteAttribute (writer, "group_grouptype", "SCALAR"); + break; + default: + assert (0); + } WriteAttribute (writer, "group_dim", CCTK_GroupDimI(group)); WriteAttribute (writer, "group_timelevel", tl); WriteAttribute (writer, "group_numtimelevels", CCTK_NumTimeLevelsI(group)); @@ -871,7 +883,7 @@ namespace CarpetIOFlexIO { void WriteAttribute (IObase* writer, const char* name, const char * values) { - WriteAttribute (writer, name, values, strlen(values)); + WriteAttribute (writer, name, values, strlen(values) + 1); } void WriteAttribute (IObase* writer, const char* name, -- cgit v1.2.3