Checkpoint
This commit is contained in:
@@ -6,7 +6,7 @@ namespace Foodsoft.Alpm
|
||||
public readonly struct Backup : IEquatable<Backup>
|
||||
{
|
||||
public string Name { get; }
|
||||
public string Hash { get; }
|
||||
public string? Hash { get; }
|
||||
|
||||
public bool Equals(Backup other)
|
||||
{
|
||||
@@ -24,17 +24,17 @@ namespace Foodsoft.Alpm
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private readonly unsafe struct NativeBackup
|
||||
private readonly struct NativeBackup
|
||||
{
|
||||
internal readonly sbyte* name;
|
||||
internal readonly sbyte* hash;
|
||||
internal readonly IntPtr name;
|
||||
internal readonly IntPtr hash;
|
||||
}
|
||||
|
||||
internal unsafe Backup(IntPtr ptr)
|
||||
{
|
||||
var native = (NativeBackup*) ptr;
|
||||
Name = new string(native->name);
|
||||
Hash = new string(native->hash);
|
||||
Name = Marshal.PtrToStringUTF8(native->name)!;
|
||||
Hash = Marshal.PtrToStringUTF8(native->hash)!;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user