summaryrefslogtreecommitdiffstats
path: root/tools/src
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2022-07-01 19:53:45 (GMT)
committerGitHub <noreply@github.com>2022-07-01 19:53:45 (GMT)
commit6aa7aeeda415287c3995fe3140bda86445023ab5 (patch)
tree77ebd53724d712619ace9cf2c7d1cbdfc83e3d63 /tools/src
parent9e97a22b8bb7cc92f0b2ef2b63de61e9da50aba6 (diff)
downloadhdf5-6aa7aeeda415287c3995fe3140bda86445023ab5.zip
hdf5-6aa7aeeda415287c3995fe3140bda86445023ab5.tar.gz
hdf5-6aa7aeeda415287c3995fe3140bda86445023ab5.tar.bz2
Fixes a bug in h5perf that causes file open failures (#1846)
When the filename was flipped from being a static array to being dynamically allocated, the sizeof(filename) call wasn't updated. This always returns the size of the pointer, truncating the filename.
Diffstat (limited to 'tools/src')
-rw-r--r--tools/src/h5perf/pio_engine.c2
-rw-r--r--tools/src/h5perf/sio_engine.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/tools/src/h5perf/pio_engine.c b/tools/src/h5perf/pio_engine.c
index d50e783..b546c43 100644
--- a/tools/src/h5perf/pio_engine.c
+++ b/tools/src/h5perf/pio_engine.c
@@ -286,7 +286,7 @@ do_pio(parameters param)
char base_name[256];
HDsnprintf(base_name, sizeof(base_name), "#pio_tmp_%lu", nf);
- pio_create_filename(iot, base_name, fname, sizeof(fname));
+ pio_create_filename(iot, base_name, fname, FILENAME_MAX);
if (pio_debug_level > 0)
HDfprintf(output, "rank %d: data filename=%s\n", pio_mpi_rank_g, fname);
diff --git a/tools/src/h5perf/sio_engine.c b/tools/src/h5perf/sio_engine.c
index e113e82..7781f80 100644
--- a/tools/src/h5perf/sio_engine.c
+++ b/tools/src/h5perf/sio_engine.c
@@ -203,7 +203,7 @@ do_sio(parameters param, results *res)
/* Open file for write */
HDstrcpy(base_name, "#sio_tmp");
- sio_create_filename(iot, base_name, fname, sizeof(fname), &param);
+ sio_create_filename(iot, base_name, fname, FILENAME_MAX, &param);
if (sio_debug_level > 0)
HDfprintf(output, "data filename=%s\n", fname);