mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 13:37:00 -04:00
Fix: index out of bounds
This commit is contained in:
@@ -347,7 +347,7 @@ size_t cursor_to_index(const String& str, size_t cursor, Movement dir) {
|
|||||||
if (str.GetChar(i) == _('<')) {
|
if (str.GetChar(i) == _('<')) {
|
||||||
String tag1 = tag_at(str, i);
|
String tag1 = tag_at(str, i);
|
||||||
i = skip_tag(str, i);
|
i = skip_tag(str, i);
|
||||||
if (str.GetChar(i) == _('<')) {
|
if (i < str.size() && str.GetChar(i) == _('<')) {
|
||||||
String tag2 = tag_at(str, i);
|
String tag2 = tag_at(str, i);
|
||||||
if (_("<") + tag2 + _(">") == anti_tag(tag1)) {
|
if (_("<") + tag2 + _(">") == anti_tag(tag1)) {
|
||||||
return i;
|
return i;
|
||||||
|
|||||||
Reference in New Issue
Block a user