diff options
author | Jordan Henderson <jhenderson@hdfgroup.org> | 2019-01-08 21:52:30 (GMT) |
---|---|---|
committer | Jordan Henderson <jhenderson@hdfgroup.org> | 2019-01-08 21:52:30 (GMT) |
commit | 2d7eb9a4c3a841f7612b88f6b559792cb6143930 (patch) | |
tree | 97c612317c334a25d22d550412a864c307a8be38 /src/H5A.c | |
parent | 3f727a272c5511efd25d1417d435cb71fc3062b4 (diff) | |
download | hdf5-2d7eb9a4c3a841f7612b88f6b559792cb6143930.zip hdf5-2d7eb9a4c3a841f7612b88f6b559792cb6143930.tar.gz hdf5-2d7eb9a4c3a841f7612b88f6b559792cb6143930.tar.bz2 |
Align behavior of H5Aget_name_by_idx with H5Aget_name when a NULL buffer is supplied
Diffstat (limited to 'src/H5A.c')
-rw-r--r-- | src/H5A.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -951,6 +951,8 @@ H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") if(!obj_name || !*obj_name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") + if(!name && size) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name cannot be NULL if size is non-zero") if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) |