summaryrefslogtreecommitdiffstats
path: root/testpar/t_pflush1.c
diff options
context:
space:
mode:
Diffstat (limited to 'testpar/t_pflush1.c')
-rw-r--r--testpar/t_pflush1.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/testpar/t_pflush1.c b/testpar/t_pflush1.c
index 2a80f4a..0500a2d 100644
--- a/testpar/t_pflush1.c
+++ b/testpar/t_pflush1.c
@@ -43,7 +43,7 @@ static int data_g[100][100];
*-------------------------------------------------------------------------
*/
static hid_t
-create_test_file(char *name, hid_t fapl_id)
+create_test_file(char *name, size_t name_length, hid_t fapl_id)
{
hid_t fid = H5I_INVALID_HID;
hid_t dcpl_id = H5I_INVALID_HID;
@@ -86,7 +86,7 @@ create_test_file(char *name, hid_t fapl_id)
if ((top_level_gid = H5Gcreate2(fid, "some_groups", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
for (i = 0; i < N_GROUPS; i++) {
- HDsprintf(name, "grp%02u", (unsigned)i);
+ HDsnprintf(name, name_length, "grp%02u", (unsigned)i);
if ((gid = H5Gcreate2(top_level_gid, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
if (H5Gclose(gid) < 0)
@@ -133,7 +133,7 @@ main(int argc, char *argv[])
TESTING("H5Fflush (part1)");
/* Don't run using the split VFD */
- envval = HDgetenv("HDF5_DRIVER");
+ envval = HDgetenv(HDF5_DRIVER);
if (envval == NULL)
envval = "nomatch";
@@ -153,7 +153,7 @@ main(int argc, char *argv[])
/* Create the file */
h5_fixname(FILENAME[0], fapl_id, name, sizeof(name));
- if ((fid1 = create_test_file(name, fapl_id)) < 0)
+ if ((fid1 = create_test_file(name, sizeof(name), fapl_id)) < 0)
goto error;
/* Flush and exit without closing the library */
if (H5Fflush(fid1, H5F_SCOPE_GLOBAL) < 0)
@@ -161,7 +161,7 @@ main(int argc, char *argv[])
/* Create the other file which will not be flushed */
h5_fixname(FILENAME[1], fapl_id, name, sizeof(name));
- if ((fid2 = create_test_file(name, fapl_id)) < 0)
+ if ((fid2 = create_test_file(name, sizeof(name), fapl_id)) < 0)
goto error;
if (mpi_rank == 0)
@@ -207,5 +207,7 @@ error:
HDfflush(stderr);
HDprintf("*** ERROR ***\n");
HDprintf("THERE WAS A REAL ERROR IN t_pflush1.\n");
+ HDfflush(stdout);
+
HD_exit(EXIT_FAILURE);
} /* end main() */