From f39daa1d89a001bcf64a744fd6487c28f69b097a Mon Sep 17 00:00:00 2001 From: proddy Date: Wed, 21 Oct 2020 13:42:58 +0200 Subject: [PATCH] fix error not showing telegram handler in watch mode --- src/emsesp.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/emsesp.cpp b/src/emsesp.cpp index 30c7e7961..7c8d5dc72 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -237,7 +237,7 @@ void EMSESP::show_ems(uuid::console::Shell & shell) { } else { shell.printfln(F("Tx Queue (%ld telegram%s):"), tx_telegrams.size(), tx_telegrams.size() == 1 ? "" : "s"); - std::string op(10, '\0'); + std::string op; for (const auto & it : tx_telegrams) { if ((it.telegram_->operation) == Telegram::Operation::TX_RAW) { op = read_flash_string(F("RAW ")); @@ -387,9 +387,9 @@ std::string EMSESP::pretty_telegram(std::shared_ptr telegram) { uint8_t offset = telegram->offset; // find name for src and dest by looking up known devices - std::string src_name(20, '\0'); - std::string dest_name(20, '\0'); - std::string type_name(20, '\0'); + std::string src_name; + std::string dest_name; + std::string type_name; for (const auto & emsdevice : emsdevices) { if (emsdevice) { // get src & dest @@ -425,7 +425,6 @@ std::string EMSESP::pretty_telegram(std::shared_ptr telegram) { } std::string str(200, '\0'); - if (offset) { snprintf_P(&str[0], str.capacity() + 1,