@@ -49,7 +49,7 @@ std::string YamlRawSourceEncode(const RawSource& rhs)
|
|||||||
break;
|
break;
|
||||||
case SOURCE_TYPE_CUSTOM_SWITCH:
|
case SOURCE_TYPE_CUSTOM_SWITCH:
|
||||||
src_str += "ls(";
|
src_str += "ls(";
|
||||||
src_str += std::to_string(rhs.index);
|
src_str += std::to_string(rhs.index + 1);
|
||||||
src_str += ")";
|
src_str += ")";
|
||||||
break;
|
break;
|
||||||
case SOURCE_TYPE_CYC:
|
case SOURCE_TYPE_CYC:
|
||||||
@@ -139,8 +139,8 @@ RawSource YamlRawSourceDecode(const std::string& src_str)
|
|||||||
std::stringstream src(src_str.substr(3));
|
std::stringstream src(src_str.substr(3));
|
||||||
int ls = 0;
|
int ls = 0;
|
||||||
src >> ls;
|
src >> ls;
|
||||||
if (ls < CPN_MAX_LOGICAL_SWITCHES)
|
if (ls > 0 && ls < CPN_MAX_LOGICAL_SWITCHES)
|
||||||
rhs = RawSource(SOURCE_TYPE_CUSTOM_SWITCH, ls);
|
rhs = RawSource(SOURCE_TYPE_CUSTOM_SWITCH, ls - 1);
|
||||||
|
|
||||||
} else if (val_len > 3 &&
|
} else if (val_len > 3 &&
|
||||||
val[0] == 't' &&
|
val[0] == 't' &&
|
||||||
|
|||||||
Reference in New Issue
Block a user