Fix array reference

GC strings are 22 bytes long, but GBA strings are 10 & 7 bytes long. If a 7-char OT name is generated in C/XD and transferred, it would try iterating to the 8th char which is OOB for dest.
Iterate over the smaller array, which is always dest (in this method).
This commit is contained in:
Kurt 2024-10-03 14:44:22 -05:00
parent 7632230edf
commit 1dc94152c3

View file

@ -132,7 +132,7 @@ public static class StringConverter3GC
var table = jpn ? CharTableJPN : CharTableINT;
int i = 0;
for (; i < data.Length; i++)
for (; i < dest.Length; i++)
{
var c = (char)ReadUInt16BigEndian(data[(i * 2)..]);
if (c == TerminatorBigEndian)