summaryrefslogtreecommitdiffstats
path: root/test/testmeta.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/testmeta.c')
-rw-r--r--test/testmeta.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/testmeta.c b/test/testmeta.c
index a3b5160..a62977b 100644
--- a/test/testmeta.c
+++ b/test/testmeta.c
@@ -83,7 +83,7 @@ main(void)
for (i = 0; i < NEXTARRAYS; i++) {
/* Create dataset */
- HDsprintf(name, "/ExtArray%06d", i);
+ HDsnprintf(name, sizeof(name), "/ExtArray%06d", i);
dataset_id =
H5Dcreate2(file_id, name, H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, prop_id, H5P_DEFAULT);
@@ -108,7 +108,7 @@ main(void)
floatval = (float)j;
/* Create group to hold data arrays for this object */
- HDsprintf(name, "/DataArray/%06d", j);
+ HDsnprintf(name, sizeof(name), "/DataArray/%06d", j);
group_id = H5Gcreate2(file_id, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (group_id < 0) {
HDfprintf(stderr, "Failed to create DataArray group.\n");
@@ -124,7 +124,7 @@ main(void)
dataspace_id = H5Screate_simple(1, dims, maxdims);
/* Create dataset */
- HDsprintf(name, "DataArray%06d", i);
+ HDsnprintf(name, sizeof(name), "DataArray%06d", i);
dataset_id = H5Dcreate2(group_id, name, H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT,
H5P_DEFAULT);
if (dataset_id < 0) {
@@ -170,7 +170,7 @@ main(void)
/* Extend attribute arrays */
for (i = 0; i < NEXTARRAYS; i++) {
/* Open extendable dataset */
- HDsprintf(name, "/ExtArray%06d", i);
+ HDsnprintf(name, sizeof(name), "/ExtArray%06d", i);
dataset_id = H5Dopen2(file_id, name, H5P_DEFAULT);
if (dataset_id < 0) {
HDfprintf(stderr, "Failed to open ExtArray dataset.\n");