From acc3ac0da821a987ec76803a0c89f16e9122d9a7 Mon Sep 17 00:00:00 2001 From: Elena Pourmal Date: Thu, 24 Feb 2000 17:09:01 -0500 Subject: [svn-r1990] Problem: Example did not define string datatype correctly for one of the attributes. H5Tset_strpad call was missing. This fix closes bug #323. --- examples/h5_attribute.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/h5_attribute.c b/examples/h5_attribute.c index fd41b0d..03207b6 100644 --- a/examples/h5_attribute.c +++ b/examples/h5_attribute.c @@ -118,6 +118,7 @@ main (void) aid3 = H5Screate(H5S_SCALAR); atype = H5Tcopy(H5T_C_S1); H5Tset_size(atype, 4); + H5Tset_strpad(atype,H5T_STR_NULLTERM); attr3 = H5Acreate(dataset, ANAMES, atype, aid3, H5P_DEFAULT); /* @@ -176,7 +177,7 @@ main (void) atype = H5Tcopy(H5T_C_S1); H5Tset_size(atype, 5); ret = H5Aread(attr, atype, string_out); - printf("The value of the attribute with the index 2 is %s \n", string_out); + printf("The value of the attribute with index 2 is %s \n", string_out); ret = H5Aclose(attr); ret = H5Tclose(atype); -- cgit v0.12