fix bug where channels imported from older config files displayed gibberish in channel scope under settingsscreen even when region scope not set; fix bug where after device clock sync advert times last heard weren't displaying correctly (ie showed 16895h)

This commit is contained in:
pelgraine
2026-04-19 20:23:12 +10:00
parent 46413b9858
commit 31ac732f08
3 changed files with 40 additions and 0 deletions
+11
View File
@@ -636,6 +636,17 @@ void DataStore::loadChannels(DataStoreHost* host) {
if (!success) break; // EOF
// Sanitize scope_name — reject if it contains non-region characters
// (catches garbage from uninitialised memory in early channels3 files)
ch.scope_name[30] = '\0'; // force null-terminate
for (int s = 0; ch.scope_name[s]; s++) {
char sc = ch.scope_name[s];
if (!((sc >= 'a' && sc <= 'z') || (sc >= '0' && sc <= '9') || sc == '-')) {
memset(ch.scope_name, 0, sizeof(ch.scope_name)); // invalid — clear
break;
}
}
if (host->onChannelLoaded(channel_idx, ch)) {
channel_idx++;
} else {