diff options
author | Sean McBride <sean@rogue-research.com> | 2022-01-28 22:43:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-28 22:43:48 (GMT) |
commit | 4ac6ccc0213767be935b2686524937ae93c46e3f (patch) | |
tree | 9cd332106bd623c05f8e6837bed0d1ceab5ad7e9 /src/H5trace.c | |
parent | ad71539d30c799c497953c18352df37d83a75310 (diff) | |
download | hdf5-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 'src/H5trace.c')
-rw-r--r-- | src/H5trace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/H5trace.c b/src/H5trace.c index 5d15fee..8790a88 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -4023,7 +4023,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) H5_timer_get_times(function_timer, &function_times); H5_timer_get_times(running_timer, &running_times); - HDsprintf(tmp, "%.6f", (function_times.elapsed - running_times.elapsed)); + HDsnprintf(tmp, sizeof(tmp), "%.6f", (function_times.elapsed - running_times.elapsed)); H5RS_asprintf_cat(rs, " %*s ", (int)HDstrlen(tmp), ""); } for (i = 0; i < current_depth; i++) |