Bring back null termination that slipped away
This commit is contained in:
parent
f62dfa8f73
commit
a88cabd417
@ -195,6 +195,7 @@ public class DiscordRpc
|
|||||||
input.CopyTo(0, _chrBuffer, 0, len);
|
input.CopyTo(0, _chrBuffer, 0, len);
|
||||||
var convbytecnt = Encoding.UTF8.GetBytes(_chrBuffer, 0, len, _byteBuffer, 0);
|
var convbytecnt = Encoding.UTF8.GetBytes(_chrBuffer, 0, len, _byteBuffer, 0);
|
||||||
IntPtr buffer = Marshal.AllocHGlobal(convbytecnt + 1);
|
IntPtr buffer = Marshal.AllocHGlobal(convbytecnt + 1);
|
||||||
|
Marshal.WriteByte(buffer, convbytecnt, 0);
|
||||||
_buffers.Add(buffer);
|
_buffers.Add(buffer);
|
||||||
Marshal.Copy(_byteBuffer, 0, buffer, convbytecnt);
|
Marshal.Copy(_byteBuffer, 0, buffer, convbytecnt);
|
||||||
return buffer;
|
return buffer;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user