diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2022-04-08 14:25:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-08 14:25:14 (GMT) |
commit | 6fad870737605a39103dc8f26b9799e158a3ee16 (patch) | |
tree | 1dc7a66327199cd9fa80c714243f33a83f13d1f5 /c++/test/tattr.cpp | |
parent | 304d33f88b657c3a93da311c47a62cfca5af12c3 (diff) | |
download | hdf5-feature/parallel_h5repack.zip hdf5-feature/parallel_h5repack.tar.gz hdf5-feature/parallel_h5repack.tar.bz2 |
Sync branch with develop (#1616)feature/parallel_h5repack
Sync branch with develop
Diffstat (limited to 'c++/test/tattr.cpp')
-rw-r--r-- | c++/test/tattr.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index 26699d2..dc968f9 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -95,7 +95,7 @@ struct attr4_struct { const H5std_string ATTR5_NAME("Attr5"); const int ATTR5_RANK = 0; -float attr_data5 = -5.123f; // Test data for 5th attribute +float attr_data5 = -5.123F; // Test data for 5th attribute /* Info for another attribute */ const H5std_string ATTR1A_NAME("Attr1_a"); @@ -1782,7 +1782,7 @@ test_attr_dense_create(FileCreatPropList &fcpl, FileAccPropList &fapl) unsigned attr_num; for (attr_num = 0; attr_num < max_compact; attr_num++) { // Create attribute - sprintf(attr_name, "attr %02u", attr_num); + snprintf(attr_name, sizeof(attr_name), "attr %02u", attr_num); Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); // Write data to the attribute @@ -1794,7 +1794,7 @@ test_attr_dense_create(FileCreatPropList &fcpl, FileAccPropList &fapl) { // Add one more attribute, to push into "dense" storage // Create another attribute - sprintf(attr_name, "attr %02u", attr_num); + snprintf(attr_name, sizeof(attr_name), "attr %02u", attr_num); Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); // Write data to the attribute @@ -1804,7 +1804,7 @@ test_attr_dense_create(FileCreatPropList &fcpl, FileAccPropList &fapl) // Attempt to add attribute again, which should fail try { // Create another attribute - sprintf(attr_name, "attr %02u", attr_num); + snprintf(attr_name, sizeof(attr_name), "attr %02u", attr_num); Attribute attr = dataset.createAttribute(attr_name, PredType::NATIVE_UINT, ds_space); // continuation here, that means no exception has been thrown |