From 91a4fc2f6c5dae2f67bb8627832a45da6f640ce6 Mon Sep 17 00:00:00 2001 From: Siepert123 Date: Wed, 4 Mar 2026 21:37:38 +0100 Subject: [PATCH] Do not use _countof, use sizeof(label)/sizeof(wchar_t) or make label std::array and call .size() --- Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp b/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp index efd4e790f..73981533b 100644 --- a/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp +++ b/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp @@ -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);