diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2014-02-04 15:11:20 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2014-02-04 15:11:20 (GMT) |
commit | ee10548723a74680a65ad0f324602e172b246f19 (patch) | |
tree | 2e67acad33935c24f775699187c4ac253baef750 /src/H5R.c | |
parent | ddf75b10f64026f9e1c55534997c2b3a37af0140 (diff) | |
download | hdf5-ee10548723a74680a65ad0f324602e172b246f19.zip hdf5-ee10548723a74680a65ad0f324602e172b246f19.tar.gz hdf5-ee10548723a74680a65ad0f324602e172b246f19.tar.bz2 |
[svn-r24681] Description:
Fix for HDF5/HDFFV-8620 H5Rget_name with NULL name parameter fails.
The name parameter now excepts NULL, in which case the length of then
name is returned.
Tested: jam (intel and gnu)
Diffstat (limited to 'src/H5R.c')
-rw-r--r-- | src/H5R.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -894,7 +894,6 @@ H5R_get_name(H5F_t *f, hid_t lapl_id, hid_t dxpl_id, hid_t id, H5R_type_t ref_ty /* Check args */ HDassert(f); HDassert(_ref); - HDassert(name); /* Initialize the object location */ H5O_loc_reset(&oloc); @@ -965,8 +964,10 @@ done: object that the dataset is located within. H5R_type_t ref_type; IN: Type of reference void *ref; IN: Reference to query. - char *name; OUT: Buffer to place name of object referenced - size_t size; IN: Size of name buffer + char *name; OUT: Buffer to place name of object referenced. If NULL + then this call will return the size in bytes of name. + size_t size; IN: Size of name buffer (user needs to include NULL terminator + when passing in the size) RETURNS Non-negative length of the path on success, Negative on failure @@ -978,6 +979,12 @@ done: This may not be the only path to that object. EXAMPLES REVISION LOG + M. Scot Breitenfeld + 22 January 2014 + Changed the behavior for the returned value of the function when name is NULL. + If name is NULL then size is ignored and the function returns the size + of the name buffer (not including the NULL terminator), it still returns + negative on failure. --------------------------------------------------------------------------*/ ssize_t H5Rget_name(hid_t id, H5R_type_t ref_type, const void *_ref, char *name, |