Skip to content

Commit

Permalink
Force to clean last byte if using ArrayPool.Rent
Browse files Browse the repository at this point in the history
  • Loading branch information
Milkitic committed Mar 21, 2022
1 parent 2d52c16 commit 7df9d46
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/KbinXml.Net/Writers/DataWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public void WriteString(string value)
{
var span = arr.AsSpan(0, length);
bytes.CopyTo(span);
span[bytes.Length] = 0;

WriteU32((uint)length);
Write32BitAligned(span);
Expand Down

0 comments on commit 7df9d46

Please sign in to comment.