diff --git a/src/LibHac/Common/U8Span.cs b/src/LibHac/Common/U8Span.cs index 92cd9978..25daf063 100644 --- a/src/LibHac/Common/U8Span.cs +++ b/src/LibHac/Common/U8Span.cs @@ -90,7 +90,7 @@ namespace LibHac.Common /// /// if the span has no buffer. /// Otherwise, . - public bool IsNull() => _buffer.IsEmpty; + public unsafe bool IsNull() => (IntPtr)Unsafe.AsPointer(ref MemoryMarshal.GetReference(_buffer)) == IntPtr.Zero; /// /// Checks if the has no buffer or begins with a null terminator. diff --git a/src/LibHac/Common/U8SpanMutable.cs b/src/LibHac/Common/U8SpanMutable.cs index 418fdccc..7d782ff2 100644 --- a/src/LibHac/Common/U8SpanMutable.cs +++ b/src/LibHac/Common/U8SpanMutable.cs @@ -86,7 +86,7 @@ namespace LibHac.Common /// /// if the span has no buffer. /// Otherwise, . - public bool IsNull() => _buffer.IsEmpty; + public unsafe bool IsNull() => (IntPtr)Unsafe.AsPointer(ref MemoryMarshal.GetReference(_buffer)) == IntPtr.Zero; /// /// Checks if the has no buffer or begins with a null terminator. diff --git a/src/LibHac/FsSystem/NcaUtils/Nca.cs b/src/LibHac/FsSystem/NcaUtils/Nca.cs index f9ee9676..7e55a6f4 100644 --- a/src/LibHac/FsSystem/NcaUtils/Nca.cs +++ b/src/LibHac/FsSystem/NcaUtils/Nca.cs @@ -557,7 +557,7 @@ namespace LibHac.FsSystem.NcaUtils return new HierarchicalIntegrityVerificationStorage(initInfo, integrityCheckLevel, leaveOpen); } - public IStorage OpenDecryptedHeaderStorage() => OpenHeaderStorage(true); + public IStorage OpenDecryptedHeaderStorage() => OpenHeaderStorage(false); public IStorage OpenHeaderStorage(bool openEncrypted) {