diff options
author | Robb Matzke <matzke@llnl.gov> | 2000-06-23 17:52:21 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 2000-06-23 17:52:21 (GMT) |
commit | 96f9f1859b73ba3a8d2364ffb6488fc899f9d158 (patch) | |
tree | d632007f62c2093809af48bdc5de8597cc0e8a61 /tools/h5ls.c | |
parent | 4aa0e950f9636066718d3786b1dbe09e70f413c4 (diff) | |
download | hdf5-96f9f1859b73ba3a8d2364ffb6488fc899f9d158.zip hdf5-96f9f1859b73ba3a8d2364ffb6488fc899f9d158.tar.gz hdf5-96f9f1859b73ba3a8d2364ffb6488fc899f9d158.tar.bz2 |
[svn-r2412] Fixed a variety of problems with the new H5ToolsFopen() function.
1. The `driver' table is initialized only once, making it faster and
leaking less memory.
2. The returned driver name is set to the empty string on failure.
3. Added an argument so the function cannot overwrite the end of the
drivername return value.
4. Avoids core dump when assigning driver name to return value if the
file could not be opened by any driver.
5. Changed name of function to h5dump_fopen() to follow the naming
scheme for this source file.
6. Reindented according to hdf5 code standard.
7. Added `const' qualifiers to read-only formals.
8. Removed duplicate forward declaration.
Reindented some parts of these source files that had very odd indentation
(some lines had no indentation while others had 3x what they should).
Fixed calls to H5ToolsFopen() function.
Diffstat (limited to 'tools/h5ls.c')
-rw-r--r-- | tools/h5ls.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tools/h5ls.c b/tools/h5ls.c index 9ef01e5..fec6394 100644 --- a/tools/h5ls.c +++ b/tools/h5ls.c @@ -1914,10 +1914,9 @@ main (int argc, char *argv[]) H5G_stat_t sb; iter_t iter; static char root_name[] = "/"; - char drivername[50]; + char drivername[50]; - memset(drivername, '\0',50); /* Build display table */ DISPATCH(H5G_DATASET, "Dataset", H5Dopen, H5Dclose, dataset_list1, dataset_list2); @@ -2093,9 +2092,7 @@ main (int argc, char *argv[]) file = -1; while (fname && *fname) { - - file = H5ToolsFopen(fname, drivername); - + file = h5dump_fopen(fname, drivername, sizeof drivername); if (file>=0) { if (verbose_g) { printf("Opened \"%s\" with %s driver.\n", |