diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2018-12-28 06:20:09 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2018-12-28 06:20:09 (GMT) |
commit | 75dd3c9cab57beb87d9bad767545a07141e0433b (patch) | |
tree | b69797c0c7d6fc8a497ebf21a7ee76b699f35c68 /src | |
parent | 3a05e7109a74dafaaaa2fd404638fd6ddeaafd90 (diff) | |
parent | fe30b71086d1714261869a821f725e77026ba507 (diff) | |
download | hdf5-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.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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)) { |