summaryrefslogtreecommitdiffstats
path: root/test/lheap.c
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2022-06-22 18:58:18 (GMT)
committerGitHub <noreply@github.com>2022-06-22 18:58:18 (GMT)
commitc064d3481b582653c1e0d0043a17527fd73e8c4d (patch)
tree396a5e13954c19b803aa80465938cde15140b176 /test/lheap.c
parentd6f05069c1a3642bbebf7ec27e7df809f0675f13 (diff)
downloadhdf5-c064d3481b582653c1e0d0043a17527fd73e8c4d.zip
hdf5-c064d3481b582653c1e0d0043a17527fd73e8c4d.tar.gz
hdf5-c064d3481b582653c1e0d0043a17527fd73e8c4d.tar.bz2
sprintf to snprintf (#1815)
* Straightforward conversion of sprintf to the safer snprintf * Trickier conversion of sprintf to safer snprintf This involved minor changes to private function signatures to take the size of the buffer. * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'test/lheap.c')
-rw-r--r--test/lheap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/lheap.c b/test/lheap.c
index 1c6a6df..c9c6ca9 100644
--- a/test/lheap.c
+++ b/test/lheap.c
@@ -97,7 +97,7 @@ main(void)
goto error;
}
for (i = 0; i < NOBJS; i++) {
- HDsprintf(buf, "%03d-", i);
+ HDsnprintf(buf, sizeof(buf), "%03d-", i);
for (j = 4; j < i; j++)
buf[j] = (char)('0' + j % 10);
if (j > 4)
@@ -137,7 +137,7 @@ main(void)
goto error;
}
for (i = 0; i < NOBJS; i++) {
- HDsprintf(buf, "%03d-", i);
+ HDsnprintf(buf, sizeof(buf), "%03d-", i);
for (j = 4; j < i; j++)
buf[j] = (char)('0' + j % 10);
if (j > 4)