summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2018-12-28 06:20:09 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2018-12-28 06:20:09 (GMT)
commit75dd3c9cab57beb87d9bad767545a07141e0433b (patch)
treeb69797c0c7d6fc8a497ebf21a7ee76b699f35c68 /src
parent3a05e7109a74dafaaaa2fd404638fd6ddeaafd90 (diff)
parentfe30b71086d1714261869a821f725e77026ba507 (diff)
downloadhdf5-75dd3c9cab57beb87d9bad767545a07141e0433b.zip
hdf5-75dd3c9cab57beb87d9bad767545a07141e0433b.tar.gz
hdf5-75dd3c9cab57beb87d9bad767545a07141e0433b.tar.bz2
Merge branch 'develop' into yay_plugins
Diffstat (limited to 'src')
-rw-r--r--src/H5A.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/H5A.c b/src/H5A.c
index 8ebd2b3..1b804d9 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -1201,10 +1201,16 @@ 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)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "old attribute name cannot be NULL")
+ if(!*old_name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "old attribute name cannot be an empty string")
+ if(!new_name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "new attribute name cannot be NULL")
+ if(!*new_name)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "new attribute name cannot be an empty string")
/* Avoid thrashing things if the names are the same */
if(HDstrcmp(old_name, new_name)) {