C++ std string length fix

Send the correct string size to stdStringCtorCString
This commit is contained in:
AzureGem 2020-10-03 08:46:55 -04:00 committed by GitHub
parent ea5d878042
commit 4c29af6a85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,8 +31,8 @@ namespace Dalamud.Game.Internal.Libc {
var pString = Marshal.AllocHGlobal(256);
// Initialize a string
var npos = new IntPtr(0xFFFFFFFF); // assumed to be -1 (0xFFFFFFFF in x86, 0xFFFFFFFF_FFFFFFFF in amd64)
var pReallocString = this.stdStringCtorCString(pString, content, npos);
var size = new IntPtr(content.Length);
var pReallocString = this.stdStringCtorCString(pString, content, size);
//Log.Verbose("Prev: {Prev} Now: {Now}", pString, pReallocString);