mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Improve pad removal of CPU brand identifier
Reverse scan CPU brand name until first non space character is found.
This commit is contained in:
parent
f015667f88
commit
baeb343164
@ -298,13 +298,17 @@ const char* GetProcessorBrand(bool bRemovePadding = true)
|
||||
|
||||
if (bRemovePadding)
|
||||
{
|
||||
for (int i = 0; i < sizeof(s_CpuBrand.name) - 1; i++)
|
||||
for (size_t i = sizeof(s_CpuBrand.name); i-- > 0; )
|
||||
{
|
||||
if (s_CpuBrand.name[i] == ' ')
|
||||
if (s_CpuBrand.name[i] != '\0')
|
||||
{
|
||||
if (s_CpuBrand.name[i + 1] == ' ')
|
||||
if (s_CpuBrand.name[i] != ' ')
|
||||
{
|
||||
s_CpuBrand.name[i] = '\0';
|
||||
if (i < (sizeof(s_CpuBrand.name) - 1))
|
||||
{
|
||||
s_CpuBrand.name[i + 1] = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user