From ec8f271d5e28d076c6a8f6c43c7ce7e8c178c664 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 960c4161f3d..ec7f563d09f 100644 --- a/radio/src/storage/yaml/yaml_datastructs_funcs.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_funcs.cpp @@ -926,7 +926,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'