summaryrefslogtreecommitdiffstats
path: root/tools/h5dump.c
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2001-01-10 21:24:54 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2001-01-10 21:24:54 (GMT)
commit8e20f98805d784a57afdaf73012d96a6ea1f1a30 (patch)
tree654de108f44deb4972268f83261b6905d4b00cc0 /tools/h5dump.c
parent2ae44ebdbadf06a6771ebe45e2784a05d17da22c (diff)
downloadhdf5-8e20f98805d784a57afdaf73012d96a6ea1f1a30.zip
hdf5-8e20f98805d784a57afdaf73012d96a6ea1f1a30.tar.gz
hdf5-8e20f98805d784a57afdaf73012d96a6ea1f1a30.tar.bz2
[svn-r3264] Purpose:
Bug fix Description: I dropped the boat on this one. I assigned prefix to NULL after it'd been allocated...My bad. Solution: Stopped doing that. Platforms tested: Linux
Diffstat (limited to 'tools/h5dump.c')
-rw-r--r--tools/h5dump.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/h5dump.c b/tools/h5dump.c
index 1f854c4..b5a7b7c 100644
--- a/tools/h5dump.c
+++ b/tools/h5dump.c
@@ -838,7 +838,7 @@ dump_attr(hid_t attr, const char *attr_name, void UNUSED *op_data)
*
*-----------------------------------------------------------------------*/
static herr_t
-dump_selected_attr(hid_t loc_id, char *name)
+dump_selected_attr(hid_t loc_id, const char *name)
{
int j;
char *obj_name, *attr_name;
@@ -1685,7 +1685,7 @@ main(int argc, const char *argv[])
{
hid_t fid, gid;
const char *progname = "h5dump";
- char *fname = NULL;
+ const char *fname = NULL;
int i, display_bb = 0, display_all = 1, newwidth = 0;
void *edata;
hid_t (*func)(void*);
@@ -1834,8 +1834,7 @@ main(int argc, const char *argv[])
/* init the find_objs_t */
info.threshold = 0;
info.prefix_len = prefix_len;
- info.prefix = malloc((size_t)info.prefix_len);
- info.prefix[0] = '\0';
+ info.prefix = calloc((size_t)info.prefix_len, 1);
info.group_table = group_table;
info.type_table = type_table;
info.dset_table = dset_table;
@@ -1843,7 +1842,6 @@ main(int argc, const char *argv[])
/* find all shared objects */
H5Giterate(fid, "/", NULL, find_objs, (void *)&info);
- prefix = NULL;
/* does there exist unamed committed data type */
for (i = 0; i < type_table->nobjs; i++)