From a4504cb2316c0144a729b541140a15a836ff5138 Mon Sep 17 00:00:00 2001 From: litefeel Date: Wed, 1 Sep 2021 19:23:56 +0800 Subject: [PATCH] Fixed crash in mumu and bluestack emulators ~~~ using UnityEngine; using ZString; public class zstringTest : MonoBehaviour { // Start is called before the first frame update void Start() { using (zstring.Block()) { var missionID = (zstring)"xxxxxx"; var intv = (zstring)12345; // crash in mumu and bluestack emulators var zzzz = missionID + intv; Debug.LogError(zzzz.ToString()); } } } ~~~ --- zstring.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zstring.cs b/zstring.cs index 04d7693..8b5c036 100644 --- a/zstring.cs +++ b/zstring.cs @@ -766,6 +766,8 @@ private unsafe static void memcpy(char* dest, char* src, int count) } private unsafe static void byteCopy(byte* dest, byte* src, int byteCount) { + Buffer.MemoryCopy(src, dest, byteCount, byteCount); + return; if (byteCount < 128) { goto g64;