[debug] Use stack buffers with buf_append helper instead of std::string

This commit is contained in:
J. Nick Koston
2026-01-05 23:32:36 -10:00
parent 5e573ee116
commit 9420ae7795
+1 -2
View File
@@ -10,10 +10,9 @@ static const char *const TAG = "debug";
const char *DebugComponent::get_reset_reason_(std::span<char, RESET_REASON_BUFFER_SIZE> buffer) {
char *buf = buffer.data();
const size_t size = RESET_REASON_BUFFER_SIZE;
#if !defined(CLANG_TIDY)
String reason = ESP.getResetReason(); // NOLINT
snprintf(buf, size, "%s", reason.c_str());
snprintf(buf, RESET_REASON_BUFFER_SIZE, "%s", reason.c_str());
return buf;
#else
buf[0] = '\0';