mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-07-27 18:47:55 +00:00
Added null check to convertSystemString [MT5]
Whithout this fix, the OrderSend method crashing if we doesn't set the "request.Comment" property.
This commit is contained in:
@@ -51,9 +51,15 @@ public struct CMqlBookInfo
|
|||||||
|
|
||||||
void convertSystemString(wchar_t* dest, String^ src)
|
void convertSystemString(wchar_t* dest, String^ src)
|
||||||
{
|
{
|
||||||
pin_ptr<const wchar_t> wch = PtrToStringChars(src);
|
if (src != nullptr) {
|
||||||
memcpy(dest, wch, wcsnlen(wch, 1000) * sizeof(wchar_t));
|
pin_ptr<const wchar_t> wch = PtrToStringChars(src);
|
||||||
dest[wcsnlen(wch, 1000)] = L'\0';
|
memcpy(dest, wch, wcsnlen(wch, 1000) * sizeof(wchar_t));
|
||||||
|
dest[wcsnlen(wch, 1000)] = L'\0';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dest[0] = L'\0';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define _DLLAPI extern "C" __declspec(dllexport)
|
#define _DLLAPI extern "C" __declspec(dllexport)
|
||||||
|
|||||||
Reference in New Issue
Block a user