summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/h5repack/h5repack_copy.c2
-rw-r--r--tools/h5repack/h5repack_opttable.c2
-rw-r--r--tools/misc/talign.c15
3 files changed, 11 insertions, 8 deletions
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c
index c936155..94bd565 100644
--- a/tools/h5repack/h5repack_copy.c
+++ b/tools/h5repack/h5repack_copy.c
@@ -1500,7 +1500,7 @@ static void print_dataset_info(hid_t dcpl_id,
printf(FORMAT_OBJ,"dset",objname );
else
{
- char str[255], temp[20];
+ char str[255], temp[28];
HDstrcpy(str,"dset ");
HDstrcat(str,strfilter);
sprintf(temp," (%.3f:1)",ratio);
diff --git a/tools/h5repack/h5repack_opttable.c b/tools/h5repack/h5repack_opttable.c
index 4ec7fcf..00e4bea 100644
--- a/tools/h5repack/h5repack_opttable.c
+++ b/tools/h5repack/h5repack_opttable.c
@@ -388,7 +388,7 @@ pack_info_t* options_get_object( const char *path,
pack_opttbl_t *table )
{
unsigned int i;
- const char tbl_path[MAX_NC_NAME];
+ const char tbl_path[MAX_NC_NAME+1]; /* +1 for start with "/" case */
for ( i = 0; i < table->nelems; i++)
diff --git a/tools/misc/talign.c b/tools/misc/talign.c
index 88ebaa6..b77d846 100644
--- a/tools/misc/talign.c
+++ b/tools/misc/talign.c
@@ -148,28 +148,31 @@ out:
result = 1;
mname = H5Tget_member_name(fix, 0);
printf("%14s (%2d) %6s = %s\n",
- mname, (int)H5Tget_member_offset(fix,0),
+ mname ? mname : "(null)", (int)H5Tget_member_offset(fix,0),
string5, (char *)(data + H5Tget_member_offset(fix, 0)));
- free(mname);
+ if(mname)
+ free(mname);
fptr = (float *)(data + H5Tget_member_offset(fix, 1));
mname = H5Tget_member_name(fix, 1);
printf("Data comparison:\n"
"%14s (%2d) %6f = %f\n"
" %6f = %f\n",
- mname, (int)H5Tget_member_offset(fix,1),
+ mname ? mname : "(null)", (int)H5Tget_member_offset(fix,1),
fok[0], fptr[0],
fok[1], fptr[1]);
- free(mname);
+ if(mname)
+ free(mname);
fptr = (float *)(data + H5Tget_member_offset(fix, 2));
mname = H5Tget_member_name(fix, 2);
printf("%14s (%2d) %6f = %f\n"
" %6f = %6f\n",
- mname, (int)H5Tget_member_offset(fix,2),
+ mname ? mname : "(null)", (int)H5Tget_member_offset(fix,2),
fnok[0], fptr[0],
fnok[1], fptr[1]);
- free(mname);
+ if(mname)
+ free(mname);
fptr = (float *)(data + H5Tget_member_offset(fix, 1));
printf("\n"