Skip to content

Commit

Permalink
Merge pull request #532 from synacktic/ezpz-string-fix
Browse files Browse the repository at this point in the history
Remove the EZPZ truncation
  • Loading branch information
paladine authored Jan 6, 2022
2 parents 6c2dce8 + c816ba3 commit 28580a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 2 additions & 0 deletions MBBSEmu.Tests/ExportedModules/Majorbbs/sprintf_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public class sprintf_Tests : ExportedModuleTestBase
[InlineData("%%%%", "%%", null)] //Escaped %
[InlineData("%%%%%", "%%%", null)] //Escaped & Unescaped %
[InlineData("%%%%% ", "%%% ", null)] //Escaped & Unescaped %
[InlineData("%-8s", "gold crowns", "gold crowns")]
[InlineData("%-8s", "gold ", "gold")]
public void sprintf_Test(string formatString, string expectedString, params object[] values)
{
Reset();
Expand Down
4 changes: 0 additions & 4 deletions MBBSEmu/HostProcess/ExportedModules/ExportedModuleBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -644,10 +644,6 @@ private protected ReadOnlySpan<byte> FormatPrintf(ReadOnlySpan<byte> stringToPar
msFormattedValue.Write(valueCache);
}
}

//Need to truncate -- EZPZ
if (msFormattedValue.Length > stringWidth)
msFormattedValue.SetLength(stringWidth);
}
msOutput.Write(msFormattedValue.ToArray());
continue;
Expand Down

0 comments on commit 28580a3

Please sign in to comment.