Fixed cpu name extraction for big.LITTLE configurations

This commit is contained in:
ptitSeb 2023-03-06 14:32:52 +01:00
parent 5e251cf478
commit 6320a07d17

View File

@ -1691,6 +1691,9 @@ const char* getCpuName()
// trim ending
while(strlen(tmp) && tmp[strlen(tmp)-1]=='\n')
tmp[strlen(tmp)-1] = 0;
// incase multiple cpu type are present, there will be multiple lines
while(strchr(tmp, '\n'))
*strchr(tmp,'\n') = ' ';
strncpy(name, tmp, 199);
return name;
}
@ -1706,6 +1709,9 @@ const char* getCpuName()
// trim ending
while(strlen(tmp) && tmp[strlen(tmp)-1]=='\n')
tmp[strlen(tmp)-1] = 0;
// incase multiple cpu type are present, there will be multiple lines
while(strchr(tmp, '\n'))
*strchr(tmp,'\n') = ' ';
snprintf(name, 199, "unknown %s cpu", tmp);
return name;
}