summaryrefslogtreecommitdiffstats
path: root/src/H5Dfarray.c
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2022-01-28 16:34:57 (GMT)
committerGitHub <noreply@github.com>2022-01-28 16:34:57 (GMT)
commitb5eed1b56324fc07154c2e2d8251d2b87505ca23 (patch)
treeb3e3840a886966ae07e50a69ab7492ebe4df876c /src/H5Dfarray.c
parent44de59b642c4d5ccf505a1072d10b63dc9fe0628 (diff)
downloadhdf5-b5eed1b56324fc07154c2e2d8251d2b87505ca23.zip
hdf5-b5eed1b56324fc07154c2e2d8251d2b87505ca23.tar.gz
hdf5-b5eed1b56324fc07154c2e2d8251d2b87505ca23.tar.bz2
Replaced several uses of sprintf with safer snprintf (#1383)
* Replaced several uses of sprintf with safer snprintf * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/H5Dfarray.c')
-rw-r--r--src/H5Dfarray.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c
index 0741e8f..ab0f0f8 100644
--- a/src/H5Dfarray.c
+++ b/src/H5Dfarray.c
@@ -415,7 +415,7 @@ H5D__farray_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void
HDassert(elmt);
/* Print element */
- HDsprintf(temp_str, "Element #%" PRIuHSIZE ":", idx);
+ HDsnprintf(temp_str, sizeof(temp_str), "Element #%" PRIuHSIZE ":", idx);
HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, temp_str, *(const haddr_t *)elmt);
FUNC_LEAVE_NOAPI(SUCCEED)
@@ -675,7 +675,7 @@ H5D__farray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const
HDassert(elmt);
/* Print element */
- HDsprintf(temp_str, "Element #%" PRIuHSIZE ":", idx);
+ HDsnprintf(temp_str, sizeof(temp_str), "Element #%" PRIuHSIZE ":", idx);
HDfprintf(stream, "%*s%-*s {%" PRIuHADDR ", %u, %0x}\n", indent, "", fwidth, temp_str, elmt->addr,
elmt->nbytes, elmt->filter_mask);