diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2002-12-02 13:12:17 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2002-12-02 13:12:17 (GMT) |
commit | a59ed2ca4ca251c1221b4713e665d8abe9b9ec94 (patch) | |
tree | b91b128188b4ca10a30973df3f2719633c83273c /src/H5G.c | |
parent | 33bdf2bc0efdfbbd8d3cb5503332c6a4345fcaf8 (diff) | |
download | hdf5-a59ed2ca4ca251c1221b4713e665d8abe9b9ec94.zip hdf5-a59ed2ca4ca251c1221b4713e665d8abe9b9ec94.tar.gz hdf5-a59ed2ca4ca251c1221b4713e665d8abe9b9ec94.tar.bz2 |
[svn-r6142] Purpose:
Code cleanup
Description:
Clean up warnings with gcc 3.2.1
Platforms tested:
FreeBSD 4.7 (sleipnir) w/C++, changes too small for triple check
Diffstat (limited to 'src/H5G.c')
-rw-r--r-- | src/H5G.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -2467,10 +2467,13 @@ H5G_get_objname_by_idx(H5G_t *grp, hsize_t idx, char* name, size_t size) ret_value = HDstrlen(udata.name); if(name && size>0) { - HDstrncpy(name, udata.name, MIN(ret_value+1,size-1)); - if(ret_value >= size) + HDstrncpy(name, udata.name, MIN((size_t)(ret_value+1),size-1)); + if((size_t)ret_value >= size) name[size-1]='\0'; } + + /* Free the duplicated name */ + H5MM_xfree(udata.name); done: FUNC_LEAVE(ret_value); |