Fixed logical switch index check in raw sources

Resolves #1474
This commit is contained in:
Raphael Coeffic
2022-01-21 07:05:54 +01:00
parent 60bbe52f63
commit 83f03a81df
@@ -139,7 +139,7 @@ RawSource YamlRawSourceDecode(const std::string& src_str)
std::stringstream src(src_str.substr(3));
int ls = 0;
src >> ls;
if (ls > 0 && ls < CPN_MAX_LOGICAL_SWITCHES)
if (ls > 0 && ls <= CPN_MAX_LOGICAL_SWITCHES)
rhs = RawSource(SOURCE_TYPE_CUSTOM_SWITCH, ls - 1);
} else if (val_len > 3 &&