summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Henderson <jhenderson@hdfgroup.org>2018-12-17 18:01:20 (GMT)
committerJordan Henderson <jhenderson@hdfgroup.org>2018-12-17 18:01:20 (GMT)
commit16cbd591cdac327da2d1576ab8751c14dbb40760 (patch)
treebbbb575700baf29abb9375c948b0d4f98ac3e09c
parent339aebc69a3e3493922b58f292a5bf6d3f3f983d (diff)
downloadhdf5-16cbd591cdac327da2d1576ab8751c14dbb40760.zip
hdf5-16cbd591cdac327da2d1576ab8751c14dbb40760.tar.gz
hdf5-16cbd591cdac327da2d1576ab8751c14dbb40760.tar.bz2
align H5Arename behavior with H5Arename_by_name
-rw-r--r--src/H5A.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/H5A.c b/src/H5A.c
index 74b0148..739cce2 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -1201,10 +1201,12 @@ H5Arename(hid_t loc_id, const char *old_name, const char *new_name)
H5TRACE3("e", "i*s*s", loc_id, old_name, new_name);
/* check arguments */
- if(!old_name || !new_name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "name is nil")
if(H5I_ATTR == H5I_get_type(loc_id))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute")
+ if(!old_name || !*old_name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no old attribute name")
+ if(!new_name || !*new_name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no new attribute name")
/* Avoid thrashing things if the names are the same */
if(HDstrcmp(old_name, new_name)) {