From 643d89f54b4bbeda726be2e9d5c6598c7da97906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Thu, 11 May 2023 20:26:17 -0600 Subject: [PATCH] uORB: Use snprintf over sprintf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- platforms/common/uORB/uORB_tests/uORBTest_UnitTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/common/uORB/uORB_tests/uORBTest_UnitTest.cpp b/platforms/common/uORB/uORB_tests/uORBTest_UnitTest.cpp index bc7cda5132..f8631fa04d 100644 --- a/platforms/common/uORB/uORB_tests/uORBTest_UnitTest.cpp +++ b/platforms/common/uORB/uORB_tests/uORBTest_UnitTest.cpp @@ -111,7 +111,7 @@ int uORBTest::UnitTest::pubsublatency_main() if (pubsubtest_print && timings) { char fname[32] {}; - sprintf(fname, PX4_STORAGEDIR"/uorb_timings%u.txt", timingsgroup); + snprintf(fname, sizeof(fname), PX4_STORAGEDIR"/uorb_timings%u.txt", timingsgroup); FILE *f = fopen(fname, "w"); if (f == nullptr) {