mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-24 23:40:39 +01:00
Fixed little bug in cache print and changed message when no cache level was found
This commit is contained in:
4
main.c
4
main.c
@@ -51,8 +51,8 @@ int main() {
|
||||
printf(TITLE_AES"%s\n",aes);
|
||||
printf(TITLE_SHA"%s\n",sha);
|
||||
printf(TITLE_L1"%s\n",l1);
|
||||
printf(TITLE_L3"%s\n",l2);
|
||||
printf(TITLE_L2"%s\n",l3);
|
||||
printf(TITLE_L2"%s\n",l2);
|
||||
printf(TITLE_L3"%s\n",l3);
|
||||
printf(TITLE_PEAK"%s\n","??? GFLOP/s");
|
||||
|
||||
free(cpuName);
|
||||
|
||||
14
udev.c
14
udev.c
@@ -115,19 +115,33 @@ char* getString_L1(struct cache* cach) {
|
||||
}
|
||||
|
||||
char* getString_L2(struct cache* cach) {
|
||||
if(cach->L2 == NO_CACHE) {
|
||||
char* string = malloc(sizeof(char)*5);
|
||||
snprintf(string,5,"None");
|
||||
return string;
|
||||
}
|
||||
else {
|
||||
//Max 4 digits and 2 for 'KB'
|
||||
int size = (4+2+1);
|
||||
char* string = malloc(sizeof(char)*size);
|
||||
snprintf(string,size,"%dKB",cach->L2/1024);
|
||||
return string;
|
||||
}
|
||||
}
|
||||
|
||||
char* getString_L3(struct cache* cach) {
|
||||
if(cach->L3 == NO_CACHE) {
|
||||
char* string = malloc(sizeof(char)*5);
|
||||
snprintf(string,5,"None");
|
||||
return string;
|
||||
}
|
||||
else {
|
||||
//Max 4 digits and 2 for 'KB'
|
||||
int size = (4+2+1);
|
||||
char* string = malloc(sizeof(char)*size);
|
||||
snprintf(string,size,"%dKB",cach->L3/1024);
|
||||
return string;
|
||||
}
|
||||
}
|
||||
|
||||
char* getString_MaxFrequency(struct frequency* freq) {
|
||||
|
||||
Reference in New Issue
Block a user