diff options
author | Leon Arber <larber@ncsa.uiuc.edu> | 2004-11-12 02:40:14 (GMT) |
---|---|---|
committer | Leon Arber <larber@ncsa.uiuc.edu> | 2004-11-12 02:40:14 (GMT) |
commit | 5d7425c68641e5ac0a2f75d8fbfe512582582395 (patch) | |
tree | 84fd294d954695d400256559ab278e8d6014e690 /src/H5Pdxpl.c | |
parent | 73a495e7ac5af18c3ad695da8eb2ead79c1a218c (diff) | |
download | hdf5-5d7425c68641e5ac0a2f75d8fbfe512582582395.zip hdf5-5d7425c68641e5ac0a2f75d8fbfe512582582395.tar.gz hdf5-5d7425c68641e5ac0a2f75d8fbfe512582582395.tar.bz2 |
[svn-r9524] Purpose:
Bug Fix
Description:
Fixed off by one error in H5Pget_data_transform
Solution:
H5Pget_data_transform, when queried for the size of the property, should
return strlen() + 1 so that the user can allocate memory for the terminating
\0 in the string.
Also fixed a typo in a comment in H5Ztrans.c
Platforms tested:
eirene, too minor to require further testing.
Misc. update:
Diffstat (limited to 'src/H5Pdxpl.c')
-rw-r--r-- | src/H5Pdxpl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 49fece6..37db704 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -115,7 +115,6 @@ ssize_t H5Pget_data_transform(hid_t plist_id, char* expression /*out*/, size_t s size_t len; char* pexp; - FUNC_ENTER_API(H5Pget_data_transform, FAIL); /* Get the plist structure */ @@ -134,6 +133,8 @@ 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) { @@ -142,7 +143,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; + ret_value = (ssize_t)len + 1; done: if(ret_value<0) { |