summaryrefslogtreecommitdiffstats
path: root/tools/h5dump/h5dump.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-11-13 15:19:50 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-11-13 15:19:50 (GMT)
commite1792ebb22c1fee3eb349b83543e6e915bd1e6f7 (patch)
tree6e3f936d7809ff0191d17454ba0cb6047abda784 /tools/h5dump/h5dump.c
parent71f3513337e800f6500551448559cecc6853aca9 (diff)
downloadhdf5-e1792ebb22c1fee3eb349b83543e6e915bd1e6f7.zip
hdf5-e1792ebb22c1fee3eb349b83543e6e915bd1e6f7.tar.gz
hdf5-e1792ebb22c1fee3eb349b83543e6e915bd1e6f7.tar.bz2
[svn-r7842] Purpose:
Bug fix Description: Variable length strings and sequences with NULL pointers were not handled by library, causing problems access the data. This also affected fill values for variable-length datatypes. Solution: Address the issues in the library by detecting NULL sequences/strings and avoid trying to convert them. Patched up dumper to display NULL sequences/strings. Platforms tested: FreeBSD 4.9 (sleipnir) h5committest
Diffstat (limited to 'tools/h5dump/h5dump.c')
-rw-r--r--tools/h5dump/h5dump.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index 77ce159..d79f4ee 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -4846,7 +4846,8 @@ xml_print_strs(hid_t did, int source)
for (i = 0; i < ssiz; i++) {
if(is_vlstr) {
onestring = *(char **)bp;
- str_size = (size_t)strlen(onestring);
+ if(onestring)
+ str_size = (size_t)strlen(onestring);
} else {
strncpy(onestring, bp, tsiz);
str_size = tsiz;
@@ -4854,7 +4855,7 @@ xml_print_strs(hid_t did, int source)
indentation(indent + COL);
if (!onestring) {
- printf("\"%s\"\n", "NULL");
+ printf("NULL\n");
} else {
char *t_onestring = xml_escape_the_string(onestring, (int)str_size);