mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 07:50:40 +01:00
Fix ascii logo in AMD. Fix output on CPUs without L3
This commit is contained in:
22
src/cpuid.c
22
src/cpuid.c
@@ -517,6 +517,10 @@ struct cache* get_cache_info(struct cpuInfo* cpu) {
|
||||
printBug("Invalid L3 size: %dMB", cach->L3/(1048576));
|
||||
return NULL;
|
||||
}
|
||||
if(cach->L2 == UNKNOWN) {
|
||||
printBug("Could not find L2 cache");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return cach;
|
||||
}
|
||||
@@ -887,20 +891,16 @@ char* get_str_l1d(struct cache* cach, struct topology* topo) {
|
||||
}
|
||||
|
||||
char* get_str_l2(struct cache* cach, struct topology* topo) {
|
||||
if(cach->L2 == UNKNOWN) {
|
||||
char* string = malloc(sizeof(char) * 5);
|
||||
snprintf(string, 5, STRING_NONE);
|
||||
return string;
|
||||
}
|
||||
return get_str_cache(cach->L2, topo, false);
|
||||
assert(cach->L2 != UNKNOWN);
|
||||
if(cach->L3 == UNKNOWN)
|
||||
return get_str_cache(cach->L2, topo, true);
|
||||
else
|
||||
return get_str_cache(cach->L2, topo, false);
|
||||
}
|
||||
|
||||
char* get_str_l3(struct cache* cach, struct topology* topo) {
|
||||
if(cach->L3 == UNKNOWN) {
|
||||
char* string = malloc(sizeof(char) * 5);
|
||||
snprintf(string, 5, STRING_NONE);
|
||||
return string;
|
||||
}
|
||||
if(cach->L3 == UNKNOWN)
|
||||
return NULL;
|
||||
return get_str_cache(cach->L3, topo, true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user