mirror of
https://github.com/cemu-project/Cemu.git
synced 2026-04-25 20:26:19 -06:00
remove trailing null byte
This commit is contained in:
parent
88b80b7a2c
commit
7eccfea36f
@ -473,8 +473,10 @@ namespace CafeSystem
|
||||
if (sysctlbyname("machdep.cpu.brand_string", NULL, &cpu_len, NULL, 0) == 0 && cpu_len > 1)
|
||||
{
|
||||
cpuName.resize(cpu_len);
|
||||
if (sysctlbyname("machdep.cpu.brand_string", cpuName.data(), &cpu_len, NULL, 0) != 0)
|
||||
if (sysctlbyname("machdep.cpu.brand_string", cpuName.data(), &cpu_len, NULL, 0) != 0 || cpu_len == 0)
|
||||
cpuName.clear();
|
||||
else if (!cpuName.empty() && cpuName.back() == '\0')
|
||||
cpuName.pop_back();
|
||||
}
|
||||
#else
|
||||
std::string cpuName = g_CPUFeatures.GetCPUName();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user