diff options
author | MuQun Yang <ymuqun@hdfgroup.org> | 2000-12-22 19:03:00 (GMT) |
---|---|---|
committer | MuQun Yang <ymuqun@hdfgroup.org> | 2000-12-22 19:03:00 (GMT) |
commit | 7332a1934e1394770c98ba129d92cf2da467ab88 (patch) | |
tree | 1189309dac3bc2c48495e4f318cdfc8fb18efc2b /tools/h4toh5sds.c | |
parent | ebe4c545e1f4286f7ddd6219bfdcf5d7c23d9364 (diff) | |
download | hdf5-7332a1934e1394770c98ba129d92cf2da467ab88.zip hdf5-7332a1934e1394770c98ba129d92cf2da467ab88.tar.gz hdf5-7332a1934e1394770c98ba129d92cf2da467ab88.tar.bz2 |
[svn-r3193]
Purpose:
bug fix
Description:
Zeroing out all memory buffer before it is being used.
Solution:
using h4toh5ZeroMemory function
Platforms tested:
linux(eirene), arabica(sun 2.7)
Diffstat (limited to 'tools/h4toh5sds.c')
-rw-r--r-- | tools/h4toh5sds.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/h4toh5sds.c b/tools/h4toh5sds.c index 3781e63..eb90e4c 100644 --- a/tools/h4toh5sds.c +++ b/tools/h4toh5sds.c @@ -85,7 +85,10 @@ int Sds_h4_to_h5(int32 file_id,int32 sds_id,hid_t h5_group,hid_t h5_dimgroup){ char* h5csds_name; herr_t ret; + /* zeroing out the memory for sdsname and sdslabel.*/ + h4toh5_ZeroMemory(sdsname,MAX_NC_NAME); + h4toh5_ZeroMemory(sdslabel,MAX_NC_NAME); /* check whether the sds is empty. */ if(SDcheckempty(sds_id,&sds_empty)== FAIL) { @@ -417,7 +420,7 @@ int Sds_h4_to_h5(int32 file_id,int32 sds_id,hid_t h5_group,hid_t h5_dimgroup){ return FAIL; } - if(sdsname != NULL) { + if(sdsname[0] != '\0') { if(h4_transpredattrs(h5dset,HDF4_OBJECT_NAME,sdsname)==FAIL){ free(sds_start); free(sds_edge); |