Fix error on appending arg set when current length equals to capacity in string formatter.

This commit is contained in:
2023-02-19 11:07:50 +08:00
parent 59c2210359
commit 9c73455761

View File

@@ -400,7 +400,7 @@ namespace System.Text.Formatting {
var segmentsLeft = false;
var prevArgIndex = 0;
do {
CheckCapacity((int)(end - curr));
CheckCapacity((int)(end - curr) + 1);
fixed (char* bufferPtr = &buffer[currentCount])
segmentsLeft = AppendSegment(ref curr, end, bufferPtr, ref prevArgIndex, ref args);
}