Fixes in Nca and U8Span

This commit is contained in:
Alex Barney 2020-08-17 18:50:18 -07:00
parent f2f2111729
commit 71824f06dc
3 changed files with 3 additions and 3 deletions

View file

@ -90,7 +90,7 @@ namespace LibHac.Common
/// </summary>
/// <returns><see langword="true"/> if the span has no buffer.
/// Otherwise, <see langword="false"/>.</returns>
public bool IsNull() => _buffer.IsEmpty;
public unsafe bool IsNull() => (IntPtr)Unsafe.AsPointer(ref MemoryMarshal.GetReference(_buffer)) == IntPtr.Zero;
/// <summary>
/// Checks if the <see cref="U8Span"/> has no buffer or begins with a null terminator.

View file

@ -86,7 +86,7 @@ namespace LibHac.Common
/// </summary>
/// <returns><see langword="true"/> if the span has no buffer.
/// Otherwise, <see langword="false"/>.</returns>
public bool IsNull() => _buffer.IsEmpty;
public unsafe bool IsNull() => (IntPtr)Unsafe.AsPointer(ref MemoryMarshal.GetReference(_buffer)) == IntPtr.Zero;
/// <summary>
/// Checks if the <see cref="U8StringMutable"/> has no buffer or begins with a null terminator.

View file

@ -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)
{