From 4f88ed4921d1650ca750113315a64e41a7c71f45 Mon Sep 17 00:00:00 2001 From: philmoz Date: Mon, 9 Sep 2024 09:50:07 +1000 Subject: [PATCH] fix(radio): CS values may be read incorrectly from yaml (#5515) --- radio/src/storage/yaml/yaml_datastructs_funcs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/storage/yaml/yaml_datastructs_funcs.cpp b/radio/src/storage/yaml/yaml_datastructs_funcs.cpp index 76730a827fb..5ef87389724 100644 --- a/radio/src/storage/yaml/yaml_datastructs_funcs.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_funcs.cpp @@ -1022,7 +1022,7 @@ static uint32_t r_swtchSrc(const YamlNode* node, const char* val, uint8_t val_le ival = switchLookupIdx(val, val_len - 1) * 3; if (ival < 0) return SWSRC_NONE; - ival += yaml_str2int(val + 3, val_len - 2); + ival += yaml_str2int(val + 3, val_len - 3); ival += SWSRC_FIRST_SWITCH; } else if (val_len > 2 && val[0] == 'S'