summaryrefslogtreecommitdiffstats
path: root/tools/test/h5dump
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2022-07-09 10:05:53 (GMT)
committerGitHub <noreply@github.com>2022-07-09 10:05:53 (GMT)
commit1227bc041118e1c9fb3fdd48c083186f5deb4676 (patch)
tree0cddd12b3652faaf7adf242b2ed936d127fae454 /tools/test/h5dump
parent57cc499009f49b40505b8b3c1ca3e405c6447a16 (diff)
downloadhdf5-feature/onion_vfd.zip
hdf5-feature/onion_vfd.tar.gz
hdf5-feature/onion_vfd.tar.bz2
Sync with develop (#1863)feature/onion_vfd
Diffstat (limited to 'tools/test/h5dump')
-rw-r--r--tools/test/h5dump/h5dumpgentest.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c
index 70b3d57..4aa6426 100644
--- a/tools/test/h5dump/h5dumpgentest.c
+++ b/tools/test/h5dump/h5dumpgentest.c
@@ -589,7 +589,7 @@ gent_attribute(void)
dims[0] = 24;
space = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(root, "/attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- HDsprintf(buf, "attribute of root group");
+ HDsnprintf(buf, sizeof(buf), "attribute of root group");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
H5Aclose(attr);
@@ -1389,7 +1389,7 @@ gent_all(void)
dims[0] = 10;
space = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(group, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- HDsprintf(buf, "abcdefghi");
+ HDsnprintf(buf, sizeof(buf), "abcdefghi");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
H5Aclose(attr);
@@ -1425,7 +1425,7 @@ gent_all(void)
dims[0] = 27;
space = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- HDsprintf(buf, "1st attribute of dset1.1.1");
+ HDsnprintf(buf, sizeof(buf), "1st attribute of dset1.1.1");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
H5Aclose(attr);
@@ -1433,7 +1433,7 @@ gent_all(void)
dims[0] = 27;
space = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(dataset, "attr2", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- HDsprintf(buf, "2nd attribute of dset1.1.1");
+ HDsnprintf(buf, sizeof(buf), "2nd attribute of dset1.1.1");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
H5Aclose(attr);
@@ -1632,7 +1632,7 @@ gent_many(void)
dims[0] = 10;
space2 = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space2, H5P_DEFAULT, H5P_DEFAULT);
- HDsprintf(buf, "abcdefghi");
+ HDsnprintf(buf, sizeof(buf), "abcdefghi");
H5Awrite(attr, H5T_NATIVE_CHAR, buf);
H5Sclose(space2);
H5Aclose(attr);
@@ -1970,9 +1970,9 @@ gent_str2(void)
dims[0] = 3;
space2 = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(dataset, "attr1", fxdlenstr2, space2, H5P_DEFAULT, H5P_DEFAULT);
- HDsprintf(&(buf2[0 * LENSTR2]), "0123456789");
- HDsprintf(&(buf2[1 * LENSTR2]), "abcdefghij");
- HDsprintf(&(buf2[2 * LENSTR2]), "ABCDEFGHIJ");
+ HDsnprintf(&(buf2[0 * LENSTR2]), LENSTR2, "0123456789");
+ HDsnprintf(&(buf2[1 * LENSTR2]), LENSTR2, "abcdefghij");
+ HDsnprintf(&(buf2[2 * LENSTR2]), LENSTR2, "ABCDEFGHIJ");
H5Awrite(attr, fxdlenstr2, buf2);
H5Sclose(space2);
H5Tclose(fxdlenstr2);
@@ -1984,7 +1984,7 @@ gent_str2(void)
for (i = 0; (hsize_t)i < sdim; i++) {
start[0] = (hsize_t)i;
- HDsprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of", i);
+ HDsnprintf(buf, sizeof(buf), "This is row %1d of type H5T_STR_NULLTERM of", i);
H5Tset_size(memtype, HDstrlen(buf) + 1);
H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
@@ -1997,7 +1997,7 @@ gent_str2(void)
for (i = 0; (hsize_t)i < sdim; i++) {
start[0] = (hsize_t)i;
- HDsprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of string array", i);
+ HDsnprintf(buf, sizeof(buf), "This is row %1d of type H5T_STR_NULLTERM of string array", i);
H5Tset_size(memtype, HDstrlen(buf) + 1);
H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
@@ -2016,7 +2016,7 @@ gent_str2(void)
for (i = 0; (hsize_t)i < sdim; i++) {
start[0] = (hsize_t)i;
- HDsprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of", i);
+ HDsnprintf(buf, sizeof(buf), "This is row %1d of type H5T_STR_NULLPAD of", i);
H5Tset_size(memtype, HDstrlen(buf) + 1);
H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
@@ -2029,7 +2029,7 @@ gent_str2(void)
for (i = 0; (hsize_t)i < sdim; i++) {
start[0] = (hsize_t)i;
- HDsprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of string array", i);
+ HDsnprintf(buf, sizeof(buf), "This is row %1d of type H5T_STR_NULLPAD of string array", i);
H5Tset_size(memtype, HDstrlen(buf) + 1);
H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
@@ -2048,7 +2048,7 @@ gent_str2(void)
for (i = 0; (hsize_t)i < sdim; i++) {
start[0] = (hsize_t)i;
- HDsprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of", i);
+ HDsnprintf(buf, sizeof(buf), "This is row %1d of type H5T_STR_SPACEPAD of", i);
H5Tset_size(memtype, HDstrlen(buf) + 1);
H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
@@ -2061,7 +2061,7 @@ gent_str2(void)
for (i = 0; (hsize_t)i < sdim; i++) {
start[0] = (hsize_t)i;
- HDsprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of string array", i);
+ HDsnprintf(buf, sizeof(buf), "This is row %1d of type H5T_STR_SPACEPAD of string array", i);
H5Tset_size(memtype, HDstrlen(buf) + 1);
H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
@@ -3930,7 +3930,7 @@ gent_large_objname(void)
group = H5Gcreate2(fid, "this_is_a_large_group_name", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
for (i = 0; i < 50; ++i) {
- HDsprintf(grp_name, "this_is_a_large_group_name%d", i);
+ HDsnprintf(grp_name, sizeof(grp_name), "this_is_a_large_group_name%d", i);
group2 = H5Gcreate2(group, grp_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group2);
}