Fix long name clamping and adjust related structures for compatibility

This commit is contained in:
Ben Meadors
2026-06-11 12:18:26 -05:00
parent 8bb5364d8c
commit c2bcec93d0
12 changed files with 146 additions and 12 deletions
+5 -1
View File
@@ -620,10 +620,14 @@ void AdminModule::handleGetModuleConfigResponse(const meshtastic_MeshPacket &mp,
* Setter methods
*/
void AdminModule::handleSetOwner(const meshtastic_User &o)
void AdminModule::handleSetOwner(meshtastic_User &o)
{
int changed = 0;
// Apps built against the older 39-byte limit may send longer names; clamp
// before the changed-compare so re-sending the same long name is a no-op.
clampLongName(o.long_name);
if (*o.long_name) {
changed |= strcmp(owner.long_name, o.long_name);
strncpy(owner.long_name, o.long_name, sizeof(owner.long_name));