From 2e8a391d571ed4371dccdb03cf39831b70e60502 Mon Sep 17 00:00:00 2001 From: selsta Date: Sat, 9 May 2026 20:09:53 +0200 Subject: [PATCH] src: replace deprecated sprintf calls --- src/blockchain_utilities/blockchain_stats.cpp | 2 +- src/device/log.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/blockchain_utilities/blockchain_stats.cpp b/src/blockchain_utilities/blockchain_stats.cpp index 87703b834..372c8f6c6 100644 --- a/src/blockchain_utilities/blockchain_stats.cpp +++ b/src/blockchain_utilities/blockchain_stats.cpp @@ -272,7 +272,7 @@ plot 'stats.csv' index "DATA" using (timecolumn(1,"%Y-%m-%d")):4 with lines, '' char buf[8]; unsigned int i; for (i=0; i<24; i++) { - sprintf(buf, "\t%02u:00", i); + snprintf(buf, sizeof(buf), "\t%02u:00", i); std::cout << buf; } } diff --git a/src/device/log.cpp b/src/device/log.cpp index 3995eac3f..448a001eb 100644 --- a/src/device/log.cpp +++ b/src/device/log.cpp @@ -38,7 +38,7 @@ namespace hw { void buffer_to_str(char *to_buff, size_t to_len, const char *buff, size_t len) { CHECK_AND_ASSERT_THROW_MES(to_len > (len*2), "destination buffer too short. At least" << (len*2+1) << " bytes required"); for (size_t i=0; i