summaryrefslogtreecommitdiffstats
path: root/src/H5Oname.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Oname.c')
-rw-r--r--src/H5Oname.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/H5Oname.c b/src/H5Oname.c
index fb44000..c1cb8c8 100644
--- a/src/H5Oname.c
+++ b/src/H5Oname.c
@@ -97,10 +97,10 @@ H5O_name_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh,
HDassert(p);
/* decode */
- if(NULL == (mesg = (H5O_name_t *)H5MM_calloc(sizeof(H5O_name_t))) ||
- NULL == (mesg->s = (char *)H5MM_malloc(HDstrlen((const char *)p) + 1)))
+ if(NULL == (mesg = (H5O_name_t *)H5MM_calloc(sizeof(H5O_name_t))))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ if(NULL == (mesg->s = (char *)H5MM_strdup((const char *)p)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
- HDstrcpy(mesg->s, (const char *)p);
/* Set return value */
ret_value = mesg;
@@ -138,9 +138,9 @@ H5O_name_encode(H5F_t UNUSED *f, hbool_t UNUSED disable_shared, uint8_t *p, cons
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* check args */
- assert(f);
- assert(p);
- assert(mesg && mesg->s);
+ HDassert(f);
+ HDassert(p);
+ HDassert(mesg && mesg->s);
/* encode */
HDstrcpy((char*)p, mesg->s);