diff --git a/Source/Engine/Platform/Mac/MacPlatform.cpp b/Source/Engine/Platform/Mac/MacPlatform.cpp index 3a4747cd8..fca66cf42 100644 --- a/Source/Engine/Platform/Mac/MacPlatform.cpp +++ b/Source/Engine/Platform/Mac/MacPlatform.cpp @@ -305,15 +305,14 @@ void MacPlatform::LogInfo() { ApplePlatform::LogInfo(); - char str[250]; - size_t strSize = sizeof(str); - if (sysctlbyname("kern.osrelease", str, &strSize, nullptr, 0) != 0) - str[0] = 0; - String osRelease(str); - if (sysctlbyname("kern.osproductversion", str, &strSize, nullptr, 0) != 0) - str[0] = 0; - String osProductVer(str); - LOG(Info, "macOS {1} (kernel {0})", osRelease, osProductVer); + constexpr int32 BufferSize = 250; + char osRelease[BufferSize], osProductVer[BufferSize]; + size_t strSize = BufferSize; + if (sysctlbyname("kern.osrelease", osRelease, &strSize, nullptr, 0) != 0) + osRelease[0] = 0; + if (sysctlbyname("kern.osproductversion", osProductVer, &strSize, nullptr, 0) != 0) + osProductVer[0] = 0; + LOG(Info, "macOS {1} (kernel {0})", StringAsUTF16(osRelease).Get(), StringAsUTF16(osProductVer).Get()); } void MacPlatform::BeforeRun()