mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-18 21:50:25 +01:00
Strip null-terminator
This commit is contained in:
@@ -37,7 +37,12 @@ public static partial class ApplePlatformHelper
|
||||
throw new NotSupportedException($"Failed to get sysctl value for {name} with error {osStatus}");
|
||||
}
|
||||
|
||||
ReadOnlySpan<byte> data = buffer.AsSpan()[..(int)length];
|
||||
if (length < 1)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
ReadOnlySpan<byte> data = buffer.AsSpan()[..(int)(length - 1)];
|
||||
return Encoding.UTF8.GetString(data);
|
||||
}
|
||||
finally
|
||||
|
||||
Reference in New Issue
Block a user