Skip to content

Commit f88b576

Browse files
Exter-NOttermandias
authored andcommitted
Remove null-terminator that was actually useless
1 parent 22cb33e commit f88b576

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Penumbra/Interop/ResourceTree/ResolveContext.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,13 @@ internal record class ResolveContext(Configuration Config, IObjectIdentifier Ide
4343

4444
if (gamePath[lastDirectorySeparator + 1] != (byte)'-' || gamePath[lastDirectorySeparator + 2] != (byte)'-')
4545
{
46-
Span<byte> prefixed = stackalloc byte[gamePath.Length + 3];
46+
Span<byte> prefixed = stackalloc byte[gamePath.Length + 2];
4747
gamePath.Span[..(lastDirectorySeparator + 1)].CopyTo(prefixed);
4848
prefixed[lastDirectorySeparator + 1] = (byte)'-';
4949
prefixed[lastDirectorySeparator + 2] = (byte)'-';
5050
gamePath.Span[(lastDirectorySeparator + 1)..].CopyTo(prefixed[(lastDirectorySeparator + 3)..]);
51-
prefixed[^1] = 0;
5251

53-
if (!Utf8GamePath.FromSpan(prefixed[..^1], out var tmp))
52+
if (!Utf8GamePath.FromSpan(prefixed, out var tmp))
5453
return null;
5554

5655
gamePath = tmp.Path.Clone();

0 commit comments

Comments
 (0)