summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-03-11 22:21:37 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-03-11 22:21:37 (GMT)
commit53c6f67778c3dc5b0e39276227c77eba93ab92f0 (patch)
treee5977b7502c1fa8d91a5ac2cccd98f6b9b822886 /src
parentfa81a84cec5fe9b8c850821934afbed9ceee8e77 (diff)
downloadhdf5-53c6f67778c3dc5b0e39276227c77eba93ab92f0.zip
hdf5-53c6f67778c3dc5b0e39276227c77eba93ab92f0.tar.gz
hdf5-53c6f67778c3dc5b0e39276227c77eba93ab92f0.tar.bz2
[svn-r14720] Description:
Minor bug fix to H5Aget_num_attrs() to return error when an invalid location ID is passed in. Tested on: Mac OS X/32 (amazon) Too minor to require h5committest
Diffstat (limited to 'src')
-rw-r--r--src/H5Adeprec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c
index 9f888c8..85cef2f 100644
--- a/src/H5Adeprec.c
+++ b/src/H5Adeprec.c
@@ -312,6 +312,8 @@ H5Aget_num_attrs(hid_t loc_id)
H5TRACE1("Is", "i", loc_id);
/* check arguments */
+ if(H5I_BADID == H5I_get_type(loc_id))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "bad location ID")
if(H5I_FILE == H5I_get_type(loc_id) || H5I_ATTR == H5I_get_type(loc_id))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute")
if(NULL == (obj = H5I_object(loc_id)))