From 0780cc508e4311a1d8c9a5f1dc4c7c2eaa8a8c28 Mon Sep 17 00:00:00 2001 From: Patrick Lu Date: Thu, 10 Jun 1999 14:14:40 -0500 Subject: [svn-r1325] fixed a bug that was due to settign the dim_n_size wrong for the dump_attr function for scalar data --- tools/h5tools.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/h5tools.c b/tools/h5tools.c index 8bff61a..7b6f51d 100644 --- a/tools/h5tools.c +++ b/tools/h5tools.c @@ -2409,7 +2409,7 @@ int copy_atomic_char(char* output, char* input, int numchar, int freespace){ (input[x+1] == 't')){ /*escape characters*/ strncat(output,input,2); x += 2; - freespace - 2; + freespace = freespace - 2; } else { /* octal number */ if (freespace < 4){ @@ -2418,7 +2418,7 @@ int copy_atomic_char(char* output, char* input, int numchar, int freespace){ else { strncat(output,input,4); x += 4; - freespace - 4; + freespace = freespace - 4; } } } @@ -2466,6 +2466,10 @@ int h5dump_attr(hid_t oid, hid_t p_type){ for (i = 0; i < ndims; i++){ nelmts *= size[i]; } + dim_n_size = size[ndims - 1]; + } + else { + dim_n_size = 1; } need = nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)); sm_buf = malloc(need); -- cgit v0.12