mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Handle empty strings in marshalling (NULL elems and count == 0)
This commit is contained in:
@@ -403,7 +403,8 @@ namespace renderdoc
|
||||
public static string PtrToStringUTF8(IntPtr elems, int count)
|
||||
{
|
||||
byte[] buffer = new byte[count];
|
||||
Marshal.Copy(elems, buffer, 0, buffer.Length);
|
||||
if (count > 0)
|
||||
Marshal.Copy(elems, buffer, 0, buffer.Length);
|
||||
return System.Text.Encoding.UTF8.GetString(buffer);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user