Skip to content

Commit b5d2175

Browse files
committed
Increase GameVersion.ToString() buffer to 48 bytes
Technically, no one would use any Major, Minor and Build version number beyond ushort.MaxValue. In any-case, the ToString should be able to print the most maximum (non-sense) characters, which is 47 characters long as follows: -2147483648.-2147483648.-2147483648.-2147483648
1 parent 27961c5 commit b5d2175

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Management/GameVersion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public readonly GameVersion GetIncrementedVersion()
117117
/// <returns>A string representation of <see cref="GameVersion"/>.</returns>
118118
public readonly string ToString(string? format, IFormatProvider? formatProvider = null)
119119
{
120-
scoped Span<char> writeStackalloc = stackalloc char[32];
120+
scoped Span<char> writeStackalloc = stackalloc char[48];
121121
return !TryFormat(writeStackalloc, out int written, format, formatProvider)
122122
? throw new InvalidOperationException("Cannot write string to stackalloc buffer!")
123123
: new string(writeStackalloc[..written]);

0 commit comments

Comments
 (0)