mirror of
https://github.com/Ryujinx/SDL2-CS.git
synced 2024-12-23 05:25:27 +00:00
Use GetChars return value
This commit is contained in:
parent
f26b55e8be
commit
dd6f7face8
|
@ -91,8 +91,8 @@ namespace SDL2
|
|||
/* Old C# requires an extra memcpy, bleh! */
|
||||
int len = (int) (ptr - (byte*) s);
|
||||
char* chars = stackalloc char[len];
|
||||
System.Text.Encoding.UTF8.GetChars((byte*) s, len, chars, len);
|
||||
string result = new string(chars);
|
||||
int strLen = System.Text.Encoding.UTF8.GetChars((byte*) s, len, chars, len);
|
||||
string result = new string(chars, 0, strLen);
|
||||
#endif
|
||||
|
||||
/* Some SDL functions will malloc, we have to free! */
|
||||
|
|
Loading…
Reference in a new issue