summaryrefslogtreecommitdiffstats
path: root/src/H5T.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-07-16 20:48:40 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-07-16 20:48:40 (GMT)
commitc97fddc786356a1832e6cb3ac3f28b781d01584d (patch)
treee9ea99bbf3387f45b18d3b6503597a1c63662cab /src/H5T.c
parentcb516077680041aecc338936d1aa3f84347e0e0d (diff)
downloadhdf5-c97fddc786356a1832e6cb3ac3f28b781d01584d.zip
hdf5-c97fddc786356a1832e6cb3ac3f28b781d01584d.tar.gz
hdf5-c97fddc786356a1832e6cb3ac3f28b781d01584d.tar.bz2
[svn-r8892] Purpose:
Code cleanup Description: Clean up a bunch of warnings and bring new code better inline with current library coding practice. Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel Too minor to require h5committest Misc. update:
Diffstat (limited to 'src/H5T.c')
-rw-r--r--src/H5T.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/H5T.c b/src/H5T.c
index 26cc8c3..4d9b032 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -2573,15 +2573,18 @@ herr_t
H5Tencode(hid_t obj_id, unsigned char* buf, size_t* nalloc)
{
H5T_t *dtype;
- herr_t ret_value;
+ herr_t ret_value=SUCCEED;
FUNC_ENTER_API (H5Tencode, FAIL);
/* Check argument and retrieve object */
if (NULL==(dtype=H5I_object_verify(obj_id, H5I_DATATYPE)))
HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
+ if (nalloc==NULL)
+ HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "NULL pointer for buffer size")
- ret_value = H5T_encode(dtype, buf, nalloc);
+ if(H5T_encode(dtype, buf, nalloc)<0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode datatype");
done:
FUNC_LEAVE_API(ret_value);
@@ -2615,7 +2618,7 @@ H5Tdecode(unsigned char* buf)
FUNC_ENTER_API (H5Tdecode, FAIL);
if (buf==NULL)
- HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "empty buffer")
+ HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "NULL pointer for buffer")
if((dt = H5T_decode(buf))==NULL)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "can't decode object");