mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-24 23:40:39 +01:00
Fix spaces bug in CPU name
This commit is contained in:
@@ -151,10 +151,13 @@ char* get_str_cpu_name_internal() {
|
|||||||
name[c++] = (edx>>24) & MASK;
|
name[c++] = (edx>>24) & MASK;
|
||||||
}
|
}
|
||||||
name[c] = '\0';
|
name[c] = '\0';
|
||||||
|
|
||||||
//Remove unused characters
|
//Remove unused characters
|
||||||
char *str = name;
|
char *str = name;
|
||||||
char *dest = name;
|
char *dest = name;
|
||||||
|
// Remove spaces before name
|
||||||
|
while (*str != '\0' && *str == ' ')str++;
|
||||||
|
// Remove spaces between the name and after it
|
||||||
while (*str != '\0') {
|
while (*str != '\0') {
|
||||||
while (*str == ' ' && *(str + 1) == ' ') str++;
|
while (*str == ' ' && *(str + 1) == ' ') str++;
|
||||||
*dest++ = *str++;
|
*dest++ = *str++;
|
||||||
@@ -403,7 +406,7 @@ struct topology* get_topology_info(struct cpuInfo* cpu) {
|
|||||||
printBug("Cant get topology because VENDOR is empty");
|
printBug("Cant get topology because VENDOR is empty");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(topo->smt_enabled)
|
if(topo->smt_enabled)
|
||||||
topo->sockets = topo->total_cores / topo->smt / topo->physical_cores; // Idea borrowed from lscpu
|
topo->sockets = topo->total_cores / topo->smt / topo->physical_cores; // Idea borrowed from lscpu
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user