diff --git a/src/NimBLEAdvertising.cpp b/src/NimBLEAdvertising.cpp index 50a9e89..af98b34 100644 --- a/src/NimBLEAdvertising.cpp +++ b/src/NimBLEAdvertising.cpp @@ -138,6 +138,7 @@ void NimBLEAdvertising::addTxPower() { */ void NimBLEAdvertising::setName(const std::string &name) { m_name.assign(name.begin(), name.end()); + m_name[name.length()] = 0; m_advData.name = &m_name[0]; m_advData.name_len = m_name.size(); m_advDataSet = false;