From a88cabd41747ab13e61f33b463f570bd931b4983 Mon Sep 17 00:00:00 2001 From: Kein Date: Tue, 13 Apr 2021 16:55:34 +0300 Subject: [PATCH] Bring back null termination that slipped away --- examples/button-clicker/Assets/DiscordRpc.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/button-clicker/Assets/DiscordRpc.cs b/examples/button-clicker/Assets/DiscordRpc.cs index 1f709be..71e9449 100644 --- a/examples/button-clicker/Assets/DiscordRpc.cs +++ b/examples/button-clicker/Assets/DiscordRpc.cs @@ -195,6 +195,7 @@ public class DiscordRpc input.CopyTo(0, _chrBuffer, 0, len); var convbytecnt = Encoding.UTF8.GetBytes(_chrBuffer, 0, len, _byteBuffer, 0); IntPtr buffer = Marshal.AllocHGlobal(convbytecnt + 1); + Marshal.WriteByte(buffer, convbytecnt, 0); _buffers.Add(buffer); Marshal.Copy(_byteBuffer, 0, buffer, convbytecnt); return buffer;