summaryrefslogtreecommitdiffstats
path: root/test/external.c
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2022-01-28 22:43:48 (GMT)
committerGitHub <noreply@github.com>2022-01-28 22:43:48 (GMT)
commit4ac6ccc0213767be935b2686524937ae93c46e3f (patch)
tree9cd332106bd623c05f8e6837bed0d1ceab5ad7e9 /test/external.c
parentad71539d30c799c497953c18352df37d83a75310 (diff)
downloadhdf5-4ac6ccc0213767be935b2686524937ae93c46e3f.zip
hdf5-4ac6ccc0213767be935b2686524937ae93c46e3f.tar.gz
hdf5-4ac6ccc0213767be935b2686524937ae93c46e3f.tar.bz2
Snprintf2 (#1399)
* Replaced many uses of sprintf with safer snprintf Many very straightforward, but in a few cases added a length parameter to some private functions, because buffer length was otherwise unknowable. * Removed unnecessary use of static on small buffers This improves thread safety. * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'test/external.c')
-rw-r--r--test/external.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/external.c b/test/external.c
index 281593c..11185b3 100644
--- a/test/external.c
+++ b/test/external.c
@@ -890,8 +890,8 @@ test_write_file_set(hid_t fapl)
for (i = 0; i < N_EXT_FILES; i++) {
char name1[64], name2[64];
- HDsprintf(name1, "extern_%dr.raw", i + 1);
- HDsprintf(name2, "extern_%dw.raw", i + 1);
+ HDsnprintf(name1, sizeof(name1), "extern_%dr.raw", i + 1);
+ HDsnprintf(name2, sizeof(name2), "extern_%dw.raw", i + 1);
if (!files_have_same_contents(name1, name2))
FAIL_PUTS_ERROR(" Output differs from expected value.")
} /* end for */