From 44b2519df4ffccbfdee91f39c866b7028f705222 Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Sat, 16 May 2026 23:23:20 +0200 Subject: [PATCH] fix: with_sender buffer too small and FS_LINE_H mismatch - with_sender[160] could hold only ~160 chars but node_name(32) + expanded(200) needs up to 234; snprintf would silently truncate the UI display entry. Increased to 240. - FS_LINE_H was 9 but Adafruit 5x7 font line height is 8, wasting 1px per line and showing 5 lines instead of 6. Co-Authored-By: Claude Sonnet 4.6 --- examples/companion_radio/MyMeshBot.h | 2 +- examples/companion_radio/ui-new/FullscreenMsgView.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/companion_radio/MyMeshBot.h b/examples/companion_radio/MyMeshBot.h index 0742bcd1..701ffeab 100644 --- a/examples/companion_radio/MyMeshBot.h +++ b/examples/companion_radio/MyMeshBot.h @@ -70,7 +70,7 @@ void MyMesh::tryBotReplyChannel(uint8_t channel_idx, const char* text) { _bot_last_reply_ms = millis(); #ifdef DISPLAY_CLASS if (_ui) { - char with_sender[160]; + char with_sender[240]; // node_name(32) + ": "(2) + expanded(200) + margin snprintf(with_sender, sizeof(with_sender), "%s: %s", _prefs.node_name, expanded); _ui->addChannelMsg(channel_idx, with_sender); } diff --git a/examples/companion_radio/ui-new/FullscreenMsgView.h b/examples/companion_radio/ui-new/FullscreenMsgView.h index 5945a728..1fa7bd0f 100644 --- a/examples/companion_radio/ui-new/FullscreenMsgView.h +++ b/examples/companion_radio/ui-new/FullscreenMsgView.h @@ -4,7 +4,7 @@ #include static const int FS_CHARS = 21; -static const int FS_LINE_H = 9; +static const int FS_LINE_H = 8; static const int FS_START_Y = 12; static const int FS_VISIBLE = (64 - FS_START_Y) / FS_LINE_H;