mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-21 18:22:32 +00:00
Improve getSafeNodeName further
This commit is contained in:
@@ -72,7 +72,7 @@ const char *getSafeNodeName(OLEDDisplay *display, meshtastic_NodeInfoLite *node)
|
|||||||
std::string s = (raw && *raw) ? sanitizeString(raw) : std::string{};
|
std::string s = (raw && *raw) ? sanitizeString(raw) : std::string{};
|
||||||
|
|
||||||
// 3) Fallback if sanitize yields empty; otherwise copy safely (truncate if needed)
|
// 3) Fallback if sanitize yields empty; otherwise copy safely (truncate if needed)
|
||||||
if (s.empty()) {
|
if (s.empty() || s == "¿" || s.find_first_not_of("¿") == std::string::npos) {
|
||||||
writeFallbackId();
|
writeFallbackId();
|
||||||
} else {
|
} else {
|
||||||
// %.*s ensures null-termination and safe truncation to buffer size - 1
|
// %.*s ensures null-termination and safe truncation to buffer size - 1
|
||||||
|
|||||||
Reference in New Issue
Block a user