From 5fe4d81fa47dd757283bb443a885f9830947d8cc Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Wed, 20 Nov 2024 15:42:24 -0500 Subject: [PATCH] Ensure strings are read properly --- SabreTools.Serialization/Printer.cs | 2 +- SabreTools.Serialization/Wrappers/WrapperBase.cs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/SabreTools.Serialization/Printer.cs b/SabreTools.Serialization/Printer.cs index 0a798ead..59651a73 100644 --- a/SabreTools.Serialization/Printer.cs +++ b/SabreTools.Serialization/Printer.cs @@ -328,7 +328,7 @@ namespace SabreTools.Serialization PIC.Print(builder, item.Model); return builder; } - + /// /// Export the item information as pretty-printed text /// diff --git a/SabreTools.Serialization/Wrappers/WrapperBase.cs b/SabreTools.Serialization/Wrappers/WrapperBase.cs index 68e1f836..86e3c386 100644 --- a/SabreTools.Serialization/Wrappers/WrapperBase.cs +++ b/SabreTools.Serialization/Wrappers/WrapperBase.cs @@ -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; }