diff options
Diffstat (limited to 'test/API/H5_api_async_test.c')
-rw-r--r-- | test/API/H5_api_async_test.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/API/H5_api_async_test.c b/test/API/H5_api_async_test.c index 7777e10..6bcbe8d 100644 --- a/test/API/H5_api_async_test.c +++ b/test/API/H5_api_async_test.c @@ -369,7 +369,7 @@ test_multi_dataset_io(void) /* Loop over datasets */ for (i = 0; i < 5; i++) { /* Set dataset name */ - sprintf(dset_name, "dset%d", i); + snprintf(dset_name, sizeof(dset_name), "dset%d", i); /* Create the dataset asynchronously */ if ((dset_id[i] = H5Dcreate_async(file_id, dset_name, H5T_NATIVE_INT, space_id, H5P_DEFAULT, @@ -450,7 +450,7 @@ test_multi_dataset_io(void) /* Loop over datasets */ for (i = 0; i < 5; i++) { /* Set dataset name */ - sprintf(dset_name, "dset%d", i); + snprintf(dset_name, sizeof(dset_name), "dset%d", i); /* Open the dataset asynchronously */ if ((dset_id[0] = H5Dopen_async(file_id, dset_name, H5P_DEFAULT, es_id)) < 0) @@ -479,7 +479,7 @@ test_multi_dataset_io(void) /* Loop over datasets */ for (i = 0; i < 5; i++) { /* Set dataset name */ - sprintf(dset_name, "dset%d", i); + snprintf(dset_name, sizeof(dset_name), "dset%d", i); /* Open the dataset asynchronously */ if ((dset_id[0] = H5Dopen_async(file_id, dset_name, H5P_DEFAULT, es_id)) < 0) @@ -619,7 +619,7 @@ test_multi_file_dataset_io(void) /* Loop over files */ for (i = 0; i < 5; i++) { /* Set file name */ - sprintf(file_name, ASYNC_API_TEST_FILE_PRINTF, i); + snprintf(file_name, sizeof(file_name), ASYNC_API_TEST_FILE_PRINTF, i); /* Create file asynchronously */ if ((file_id[i] = @@ -761,7 +761,7 @@ test_multi_file_dataset_io(void) /* Loop over files */ for (i = 0; i < 5; i++) { /* Set file name */ - sprintf(file_name, ASYNC_API_TEST_FILE_PRINTF, i); + snprintf(file_name, sizeof(file_name), ASYNC_API_TEST_FILE_PRINTF, i); /* Open the file asynchronously */ if ((file_id[0] = H5Fopen_async(file_name, H5F_ACC_RDWR, H5P_DEFAULT, es_id)) < 0) @@ -799,7 +799,7 @@ test_multi_file_dataset_io(void) /* Loop over files */ for (i = 0; i < 5; i++) { /* Set file name */ - sprintf(file_name, ASYNC_API_TEST_FILE_PRINTF, i); + snprintf(file_name, sizeof(file_name), ASYNC_API_TEST_FILE_PRINTF, i); /* Open the file asynchronously */ if ((file_id[0] = H5Fopen_async(file_name, H5F_ACC_RDONLY, H5P_DEFAULT, es_id)) < 0) @@ -929,7 +929,7 @@ test_multi_file_grp_dset_io(void) /* Loop over files */ for (i = 0; i < 5; i++) { /* Set file name */ - sprintf(file_name, ASYNC_API_TEST_FILE_PRINTF, i); + snprintf(file_name, sizeof(file_name), ASYNC_API_TEST_FILE_PRINTF, i); /* Create file asynchronously */ if ((file_id = H5Fcreate_async(file_name, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT, es_id)) < @@ -981,7 +981,7 @@ test_multi_file_grp_dset_io(void) /* Loop over files */ for (i = 0; i < 5; i++) { /* Set file name */ - sprintf(file_name, ASYNC_API_TEST_FILE_PRINTF, i); + snprintf(file_name, sizeof(file_name), ASYNC_API_TEST_FILE_PRINTF, i); /* Open the file asynchronously */ if ((file_id = H5Fopen_async(file_name, H5F_ACC_RDONLY, H5P_DEFAULT, es_id)) < 0) @@ -1039,7 +1039,7 @@ test_multi_file_grp_dset_io(void) /* Loop over files */ for (i = 0; i < 5; i++) { /* Set file name */ - sprintf(file_name, ASYNC_API_TEST_FILE_PRINTF, i); + snprintf(file_name, sizeof(file_name), ASYNC_API_TEST_FILE_PRINTF, i); /* Create file asynchronously */ if ((file_id = H5Fcreate_async(file_name, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT, es_id)) < @@ -1096,7 +1096,7 @@ test_multi_file_grp_dset_io(void) /* Loop over files */ for (i = 0; i < 5; i++) { /* Set file name */ - sprintf(file_name, ASYNC_API_TEST_FILE_PRINTF, i); + snprintf(file_name, sizeof(file_name), ASYNC_API_TEST_FILE_PRINTF, i); /* Open the file asynchronously */ if ((file_id = H5Fopen_async(file_name, H5F_ACC_RDONLY, H5P_DEFAULT, es_id)) < 0) @@ -2676,7 +2676,7 @@ cleanup_files(void) H5Fdelete(ASYNC_API_TEST_FILE, H5P_DEFAULT); for (i = 0; i <= max_printf_file; i++) { - snprintf(file_name, 64, ASYNC_API_TEST_FILE_PRINTF, i); + snprintf(file_name, sizeof(file_name), ASYNC_API_TEST_FILE_PRINTF, i); H5Fdelete(file_name, H5P_DEFAULT); } /* end for */ } |