mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Do not use _countof, use sizeof(label)/sizeof(wchar_t) or make label std::array<wchar_t, 128> and call .size()
This commit is contained in:
parent
760c49a72b
commit
91a4fc2f6c
|
|
@ -762,7 +762,7 @@ void CPlatformNetworkManagerStub::SearchForGames()
|
|||
//Add server to the list!
|
||||
FriendSessionInfo* info = new FriendSessionInfo();
|
||||
wchar_t label[128];
|
||||
wcsncpy_s(label, _countof(label), name.c_str(), _TRUNCATE);
|
||||
wcsncpy_s(label, sizeof(label)/sizeof(wchar_t), name.c_str(), _TRUNCATE);
|
||||
size_t nameLen = wcslen(label);
|
||||
info->displayLabel = new wchar_t[nameLen+1];
|
||||
wcscpy_s(info->displayLabel, nameLen + 1, label);
|
||||
|
|
|
|||
Loading…
Reference in a new issue