summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-11-12 14:16:58 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-11-12 14:16:58 (GMT)
commit8d422da811b82fe6c21147de9a71ed5a19d6d739 (patch)
treef0e3d762bd3ad275e154d11f54be47ee1ff84710
parent9b09201ce18f8d9455f3a09cf1d820e4acc3f9d6 (diff)
downloadhdf5-8d422da811b82fe6c21147de9a71ed5a19d6d739.zip
hdf5-8d422da811b82fe6c21147de9a71ed5a19d6d739.tar.gz
hdf5-8d422da811b82fe6c21147de9a71ed5a19d6d739.tar.bz2
[svn-r9526] Purpose:
Bug fix, sorta. Description: Revert change to H5Pget_data_transform() which changed len of buffer returned to be inconsistent with H5Iget_name(), etc. We should discuss this change and apply it to all the similar functions if we decide to change the return value. Platforms tested: FreeBSD 4.10 (sleipnir) Too minor to require h5committest
-rw-r--r--examples/h5_dtransform.c4
-rw-r--r--src/H5Pdxpl.c4
-rw-r--r--test/dtransform.c2
3 files changed, 4 insertions, 6 deletions
diff --git a/examples/h5_dtransform.c b/examples/h5_dtransform.c
index d013ecf..153778a 100644
--- a/examples/h5_dtransform.c
+++ b/examples/h5_dtransform.c
@@ -167,8 +167,8 @@ main (void)
/************** PART 4 **************/
transform_size = H5Pget_data_transform(dxpl_id_f_to_c, NULL, 0);
- transform = (char*) malloc(transform_size);
- H5Pget_data_transform(dxpl_id_f_to_c, transform, transform_size);
+ transform = (char*) malloc(transform_size+1);
+ H5Pget_data_transform(dxpl_id_f_to_c, transform, transform_size+1);
printf("\nTransform string (from dxpl_id_f_to_c) is: %s\n", transform);
diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c
index 37db704..db1a45b 100644
--- a/src/H5Pdxpl.c
+++ b/src/H5Pdxpl.c
@@ -133,8 +133,6 @@ ssize_t H5Pget_data_transform(hid_t plist_id, char* expression /*out*/, size_t s
if(!pexp)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Failed to retrieve transform expression");
-
-
len = HDstrlen(pexp);
if(expression)
{
@@ -143,7 +141,7 @@ ssize_t H5Pget_data_transform(hid_t plist_id, char* expression /*out*/, size_t s
expression[size-1]='\0';
}
- ret_value = (ssize_t)len + 1;
+ ret_value = (ssize_t)len;
done:
if(ret_value<0) {
diff --git a/test/dtransform.c b/test/dtransform.c
index 38d35a2..ebe90bb 100644
--- a/test/dtransform.c
+++ b/test/dtransform.c
@@ -556,7 +556,7 @@ int test_set(void)
H5Eset_auto_stack(H5E_DEFAULT, NULL, NULL);
TESTING("H5Pget_data_transform (get before set)")
- if(H5Pget_data_transform(dxpl_id, ptrgetTest, strlen(str)) < 0)
+ if(H5Pget_data_transform(dxpl_id, ptrgetTest, strlen(str)+1) < 0)
{
PASSED();
}