Switch from dynamic std::string storage to fixed-size char[]

This commit is contained in:
HarukiToreda
2025-10-14 14:14:28 -04:00
parent 6cd64cc228
commit 4bd53500c6
4 changed files with 84 additions and 99 deletions

View File

@@ -1062,7 +1062,7 @@ void CannedMessageModule::sendText(NodeNum dest, ChannelIndex channel, const cha
sm.sender = nodeDB->getNodeNum(); // us
sm.channelIndex = channel;
sm.text = std::string(message).substr(0, MAX_MESSAGE_SIZE - 1);
strncpy(sm.text, message, MAX_MESSAGE_SIZE - 1);
sm.text[MAX_MESSAGE_SIZE - 1] = '\0';
// Classify broadcast vs DM