diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2003-06-09 19:29:28 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2003-06-09 19:29:28 (GMT) |
commit | 103f7b4c921220c0d5401a46b5a095c32f1f8540 (patch) | |
tree | 6bda3bcead23564f554772247557ecb34089d786 /tools/lib/h5tools.c | |
parent | 19488a94fda323c639a6cdc8595102f44c921281 (diff) | |
download | hdf5-103f7b4c921220c0d5401a46b5a095c32f1f8540.zip hdf5-103f7b4c921220c0d5401a46b5a095c32f1f8540.tar.gz hdf5-103f7b4c921220c0d5401a46b5a095c32f1f8540.tar.bz2 |
[svn-r7006] Purpose:
Bug fix/new feature
Description:
Teach h5dump/h5ls to display variable-length datatypes correctly.
Change "raw byte" output of array elements from "0xde8141b1a818" to
"de:81:41:b1:a8:18" so that it's easier for users to read.
Platforms tested:
FreeBSD 4.8 (sleipnir)
h5committest
Misc. update:
Patch provided by Robb Matzke (matzke@llnl.gov)
Diffstat (limited to 'tools/lib/h5tools.c')
-rw-r--r-- | tools/lib/h5tools.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 50ec051..4200c50 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -445,6 +445,11 @@ h5tools_simple_prefix(FILE *stream, const h5dump_t *info, * Robb Matzke, 1999-09-29 * Understands the `per_line' property which indicates that every Nth * element should begin a new line. + * + * Robb Matzke, LLNL, 2003-06-05 + * Do not dereference the memory for a variable-length string here. + * Deref in h5tools_str_sprint() instead so recursive types are + * handled correctly. *------------------------------------------------------------------------- */ static void @@ -481,11 +486,6 @@ h5tools_dump_simple_data(FILE *stream, const h5dump_t *info, hid_t container, for (i = 0; i < nelmts; i++, ctx->cur_elmt++, elmt_counter++) { /* Render the element */ h5tools_str_reset(&buffer); - if(H5Tis_variable_str(type)) { - tmp = ((unsigned char**)mem)[i]; - h5tools_str_sprint(&buffer, info, container, type, tmp, ctx); - - } else h5tools_str_sprint(&buffer, info, container, type, mem + i * size, ctx); if (i + 1 < nelmts || (flags & END_OF_DATA) == 0) |