summaryrefslogtreecommitdiffstats
path: root/hl/tools/h5watch/h5watch.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 /hl/tools/h5watch/h5watch.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 'hl/tools/h5watch/h5watch.c')
-rw-r--r--hl/tools/h5watch/h5watch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c
index c897c91..94ca4f1 100644
--- a/hl/tools/h5watch/h5watch.c
+++ b/hl/tools/h5watch/h5watch.c
@@ -174,9 +174,9 @@ doprint(hid_t did, const hsize_t *start, const hsize_t *block, int rank)
} /* end else */
/* Floating point types should display full precision */
- sprintf(fmt_float, "%%1.%dg", FLT_DIG);
+ snprintf(fmt_float, sizeof(fmt_float), "%%1.%dg", FLT_DIG);
info.fmt_float = fmt_float;
- sprintf(fmt_double, "%%1.%dg", DBL_DIG);
+ snprintf(fmt_double, sizeof(fmt_double), "%%1.%dg", DBL_DIG);
info.fmt_double = fmt_double;
info.dset_format = "DSET-%s ";