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! */
|
/* Old C# requires an extra memcpy, bleh! */
|
||||||
int len = (int) (ptr - (byte*) s);
|
int len = (int) (ptr - (byte*) s);
|
||||||
char* chars = stackalloc char[len];
|
char* chars = stackalloc char[len];
|
||||||
System.Text.Encoding.UTF8.GetChars((byte*) s, len, chars, len);
|
int strLen = System.Text.Encoding.UTF8.GetChars((byte*) s, len, chars, len);
|
||||||
string result = new string(chars);
|
string result = new string(chars, 0, strLen);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Some SDL functions will malloc, we have to free! */
|
/* Some SDL functions will malloc, we have to free! */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user