summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJordan Henderson <jhenderson@hdfgroup.org>2018-12-17 20:25:55 (GMT)
committerJordan Henderson <jhenderson@hdfgroup.org>2018-12-17 20:30:54 (GMT)
commitb4fe787bb9fe4bfc4709a124df59dd987c9a09d2 (patch)
tree216679493df94c5c6030ae3ac3c1e4c92fe359dc /src
parent16cbd591cdac327da2d1576ab8751c14dbb40760 (diff)
downloadhdf5-b4fe787bb9fe4bfc4709a124df59dd987c9a09d2.zip
hdf5-b4fe787bb9fe4bfc4709a124df59dd987c9a09d2.tar.gz
hdf5-b4fe787bb9fe4bfc4709a124df59dd987c9a09d2.tar.bz2
Add test for H5Arename NULL/empty attribute name fix
Split checking of NULL vs. empty string arguments
Diffstat (limited to 'src')
-rw-r--r--src/H5A.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/H5A.c b/src/H5A.c
index 739cce2..cb8e310 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -1203,10 +1203,14 @@ H5Arename(hid_t loc_id, const char *old_name, const char *new_name)
/* check arguments */
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")
+ 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)) {