mirror of
https://github.com/esphome/esphome.git
synced 2026-09-15 17:18:40 +00:00
[debug] Use stack buffers with buf_append helper instead of std::string
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user