Fix several calls that had wraparound hazards.

llGetSubString("abc", 3, -1) gives "abc"; llList2List(L, 1, -1) gives L when L has length 1. In general, llGetSubString or llList2List return the whole thing when the starting index is grater than the last element in the list.

There were a number of spots with that hazard, so fix all we found.
This commit is contained in:
Sei Lisa 2017-11-01 00:36:12 +01:00 committed by Sei-Lisa
parent aa9cba13a5
commit bf8f10bfe6
15 changed files with 39 additions and 39 deletions

View file

@ -88,7 +88,7 @@ Readout_Say(string say, string SCRIPT_CHANNEL)
string Key2Number(key objKey)
{
return llGetSubString((string)llAbs((integer)("0x" + llGetSubString((string)objKey, -8, -1)) & 1073741823 ^ -1073741825), 6, -1);
return llGetSubString((string)llAbs((integer)("0x" + llGetSubString((string)objKey, -8, -1)) & 0x3FFFFFFF ^ 0xBFFFFFFF), 6, 99999);
}
init_sitters()
@ -416,10 +416,10 @@ default
}
else
{
data = llGetSubString(data, llSubStringIndex(data, "◆") + 1, -1);
data = llGetSubString(data, llSubStringIndex(data, "◆") + 1, 99999);
data = llStringTrim(data, STRING_TRIM);
string command = llGetSubString(data, 0, llSubStringIndex(data, " ") - 1);
list parts = llParseStringKeepNulls(llGetSubString(data, llSubStringIndex(data, " ") + 1, -1), [" | ", " |", "| ", "|"], []);
list parts = llParseStringKeepNulls(llGetSubString(data, llSubStringIndex(data, " ") + 1, 99999), [" | ", " |", "| ", "|"], []);
if (command == "SITTER")
{
notecard_section = llList2Integer(parts, 0);