summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorElena Pourmal <epourmal@hdfgroup.org>2000-02-24 22:09:01 (GMT)
committerElena Pourmal <epourmal@hdfgroup.org>2000-02-24 22:09:01 (GMT)
commitacc3ac0da821a987ec76803a0c89f16e9122d9a7 (patch)
tree6102ba41ce95002621ae274265415c0ed6c21a60 /examples
parent459550ed9c0053e40bb5f2632ef83f9f4795c986 (diff)
downloadhdf5-acc3ac0da821a987ec76803a0c89f16e9122d9a7.zip
hdf5-acc3ac0da821a987ec76803a0c89f16e9122d9a7.tar.gz
hdf5-acc3ac0da821a987ec76803a0c89f16e9122d9a7.tar.bz2
[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.
Diffstat (limited to 'examples')
-rw-r--r--examples/h5_attribute.c3
1 files changed, 2 insertions, 1 deletions
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);