summaryrefslogtreecommitdiffstats
path: root/test/API/H5_api_group_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/API/H5_api_group_test.c')
-rw-r--r--test/API/H5_api_group_test.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/API/H5_api_group_test.c b/test/API/H5_api_group_test.c
index 4132f64..0203ebe 100644
--- a/test/API/H5_api_group_test.c
+++ b/test/API/H5_api_group_test.c
@@ -229,7 +229,7 @@ test_create_many_groups(void)
printf("\n");
for (i = 0; i < GROUP_NUMB_MANY; i++) {
printf("\r %u/%u", i + 1, GROUP_NUMB_MANY);
- sprintf(group_name, "group %02u", i);
+ snprintf(group_name, sizeof(group_name), "group %02u", i);
if ((child_group_id =
H5Gcreate2(parent_group_id, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5_FAILED();
@@ -342,11 +342,11 @@ create_group_recursive(hid_t parent_gid, unsigned counter)
printf("\r %u/%u", counter, GROUP_DEPTH);
if (counter == 1)
- sprintf(gname, "2nd_child_group");
+ snprintf(gname, sizeof(gname), "2nd_child_group");
else if (counter == 2)
- sprintf(gname, "3rd_child_group");
+ snprintf(gname, sizeof(gname), "3rd_child_group");
else
- sprintf(gname, "%dth_child_group", counter + 1);
+ snprintf(gname, sizeof(gname), "%dth_child_group", counter + 1);
if ((child_gid = H5Gcreate2(parent_gid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5_FAILED();
printf(" couldn't create group '%s'\n", gname);