Ensure strings are read properly

This commit is contained in:
Matt Nadareski
2024-11-20 15:42:24 -05:00
parent 7d3addbf0a
commit 5fe4d81fa4
2 changed files with 6 additions and 1 deletions

View File

@@ -328,7 +328,7 @@ namespace SabreTools.Serialization
PIC.Print(builder, item.Model);
return builder;
}
/// <summary>
/// Export the item information as pretty-printed text
/// </summary>

View File

@@ -318,13 +318,17 @@ namespace SabreTools.Serialization.Wrappers
{
// If we have no cached string
if (cachedChars.Count == 0)
{
sourceDataIndex++;
continue;
}
// If we have a cached string greater than the limit
if (cachedChars.Count >= charLimit)
sourceStrings.Add(new string([.. cachedChars]));
cachedChars.Clear();
sourceDataIndex++;
continue;
}
@@ -332,6 +336,7 @@ namespace SabreTools.Serialization.Wrappers
if (cachedChars.Count >= 64 && cachedChars.TrueForAll(c => c == cachedChars[0]))
{
cachedChars.Clear();
sourceDataIndex++;
continue;
}