public unsafe byte* strsave(string str) { byte[] bytes = enc.GetBytes(str); byte* p = vimremote_malloc((UIntPtr)(bytes.Length + 1)); for (int i = 0; i < bytes.Length; i++) { p[i] = bytes[i]; } p[bytes.Length] = 0; return p; }