mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-09-22 06:45:03 +00:00
Add back truncation
This commit is contained in:
@@ -1230,6 +1230,12 @@ namespace BurnOutSharp.Builder
|
||||
}
|
||||
else
|
||||
{
|
||||
if (stringLength * 2 > entry.Data.Length - offset)
|
||||
{
|
||||
Console.WriteLine($"{stringLength * 2} requested but {entry.Data.Length - offset} remains");
|
||||
stringLength = (ushort)((entry.Data.Length - offset) / 2);
|
||||
}
|
||||
|
||||
string stringValue = Encoding.Unicode.GetString(entry.Data, offset, stringLength * 2);
|
||||
offset += stringLength * 2;
|
||||
stringValue = stringValue.Replace("\n", "\\n").Replace("\r", newValue: "\\r");
|
||||
|
||||
Reference in New Issue
Block a user