mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Remove null-terminator that was actually useless
This commit is contained in:
parent
22cb33e49e
commit
f88b5761ba
1 changed files with 2 additions and 3 deletions
|
|
@ -43,14 +43,13 @@ internal record class ResolveContext(Configuration Config, IObjectIdentifier Ide
|
||||||
|
|
||||||
if (gamePath[lastDirectorySeparator + 1] != (byte)'-' || gamePath[lastDirectorySeparator + 2] != (byte)'-')
|
if (gamePath[lastDirectorySeparator + 1] != (byte)'-' || gamePath[lastDirectorySeparator + 2] != (byte)'-')
|
||||||
{
|
{
|
||||||
Span<byte> prefixed = stackalloc byte[gamePath.Length + 3];
|
Span<byte> prefixed = stackalloc byte[gamePath.Length + 2];
|
||||||
gamePath.Span[..(lastDirectorySeparator + 1)].CopyTo(prefixed);
|
gamePath.Span[..(lastDirectorySeparator + 1)].CopyTo(prefixed);
|
||||||
prefixed[lastDirectorySeparator + 1] = (byte)'-';
|
prefixed[lastDirectorySeparator + 1] = (byte)'-';
|
||||||
prefixed[lastDirectorySeparator + 2] = (byte)'-';
|
prefixed[lastDirectorySeparator + 2] = (byte)'-';
|
||||||
gamePath.Span[(lastDirectorySeparator + 1)..].CopyTo(prefixed[(lastDirectorySeparator + 3)..]);
|
gamePath.Span[(lastDirectorySeparator + 1)..].CopyTo(prefixed[(lastDirectorySeparator + 3)..]);
|
||||||
prefixed[^1] = 0;
|
|
||||||
|
|
||||||
if (!Utf8GamePath.FromSpan(prefixed[..^1], out var tmp))
|
if (!Utf8GamePath.FromSpan(prefixed, out var tmp))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
gamePath = tmp.Path.Clone();
|
gamePath = tmp.Path.Clone();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue