[svn-r3023]

Purpose:
   bug fix (zeroing memory for memory allocating for the name of dimensional list)
Description:
   At modi4, test failed due to garbage read for name of dimensional list.
Solution:
   zeroing out memory before writing the name.
Platforms tested:
   modi4, eirene(Linux)
This commit is contained in:
MuQun Yang 2000-11-29 14:05:47 -05:00
parent b3f6b6ffdd
commit c5cd064a88

View File

@ -717,6 +717,11 @@ int sdsdim_to_h5dataset(int32 sds_id,int32 sds_rank,hid_t sh5dset,
char h5dimpath_name[MAX_DIM_NAME]; char h5dimpath_name[MAX_DIM_NAME];
herr_t ret; herr_t ret;
/*zero out memory for h5sdsdim_allname and h5dimpath_name */
h4toh5_ZeroMemory(h5sdsdim_allname,(MAX_VAR_DIMS*MAX_DIM_NAME)*sizeof(char));
h4toh5_ZeroMemory(h5dimpath_name,MAX_DIM_NAME*sizeof(char));
/*check whether the sds is created with unlimited dimension. */ /*check whether the sds is created with unlimited dimension. */
if(SDgetchunkinfo(sds_id,&c_def_out, &c_flags)== FAIL) { if(SDgetchunkinfo(sds_id,&c_def_out, &c_flags)== FAIL) {
@ -781,7 +786,8 @@ int sdsdim_to_h5dataset(int32 sds_id,int32 sds_rank,hid_t sh5dset,
/* here we should add some comments for fakedim0--name. It seems that /* here we should add some comments for fakedim0--name. It seems that
hdf4(netcdf) will use unique fake dimension name, fakedim + unique hdf4(netcdf) will use unique fake dimension name, fakedim + unique
number, so check_sdsdim will never be 1 if the dimension name is fake number, so check_sdsdim will never be 1 if the dimension name is fake
name. Under this case, j will not increase if this dimension doesnot name. Under this case, count_h5objref and count_h5attrname
will not increase if this dimension doesnot
have dimensional scale data. That assures the object reference of sds is have dimensional scale data. That assures the object reference of sds is
correct. */ correct. */