diff options
-rw-r--r-- | tools/h4toh5/h4toh5vdata.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/h4toh5/h4toh5vdata.c b/tools/h4toh5/h4toh5vdata.c index 55a8bf9..e1b20d1 100644 --- a/tools/h4toh5/h4toh5vdata.c +++ b/tools/h4toh5/h4toh5vdata.c @@ -72,7 +72,7 @@ int Vdata_h4_to_h5(int32 file_id,int32 vdata_id, hid_t group_id) { VOIDP vd_data; - char vdlabel[10]; + char vdlabel[LABEL_LENG]; char vdata_name[MAX_NC_NAME]; char fieldname[MAX_NC_NAME]; char vdata_class[VSNAMELENMAX]; @@ -387,7 +387,16 @@ int Vdata_h4_to_h5(int32 file_id,int32 vdata_id, hid_t group_id) { } /* converting predefined attributes. */ - strcpy(vdlabel,VDATALABEL); + + istat = VSisattr(vdata_id); + if (istat == FAIL) { + printf("error in checking vdata attribute. \n"); + VSdetach(vdata_id); + return FAIL; + } + + if(istat) strcpy(vdlabel,VDATTRLAB); + else strcpy(vdlabel,VDATALABEL); if(h4_transpredattrs(h5dset,HDF4_OBJECT_TYPE,vdlabel)==FAIL){ printf("error in transfering vdata attributes.\n"); free(h5memtype); @@ -409,7 +418,7 @@ int Vdata_h4_to_h5(int32 file_id,int32 vdata_id, hid_t group_id) { return FAIL; } } - + if(h4_transnumattr(h5dset,HDF4_REF_NUM,vdata_ref)==FAIL){ printf("error in transfering vdata attributes.\n"); free(h5memtype); |