mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 07:50:40 +01:00
[v0.87][BUGFIX] Add checks to detect wrong ASCII arts. Fix ARM ASCII art
This commit is contained in:
@@ -52,6 +52,7 @@
|
|||||||
\
|
\
|
||||||
\
|
\
|
||||||
\
|
\
|
||||||
|
\
|
||||||
############ ########## #### ###### ######## \
|
############ ########## #### ###### ######## \
|
||||||
############### ######### ####################### \
|
############### ######### ####################### \
|
||||||
#### #### #### ##### ####### ##### \
|
#### #### #### ##### ####### ##### \
|
||||||
@@ -63,6 +64,7 @@
|
|||||||
\
|
\
|
||||||
\
|
\
|
||||||
\
|
\
|
||||||
|
\
|
||||||
"
|
"
|
||||||
|
|
||||||
#define UNKNOWN_ASCII \
|
#define UNKNOWN_ASCII \
|
||||||
@@ -86,4 +88,11 @@
|
|||||||
\
|
\
|
||||||
"
|
"
|
||||||
|
|
||||||
|
static const char* ASCII_ARRAY [] = {
|
||||||
|
AMD_ASCII,
|
||||||
|
INTEL_ASCII,
|
||||||
|
ARM_ASCII,
|
||||||
|
UNKNOWN_ASCII
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -641,6 +641,15 @@ bool print_cpufetch_arm(struct ascii* art, struct cpuInfo* cpu, struct cache* ca
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool print_cpufetch(struct cpuInfo* cpu, struct cache* cach, struct frequency* freq, struct topology* topo, STYLE s, struct colors* cs) {
|
bool print_cpufetch(struct cpuInfo* cpu, struct cache* cach, struct frequency* freq, struct topology* topo, STYLE s, struct colors* cs) {
|
||||||
|
// Sanity check of ASCII arts
|
||||||
|
for(int i=0; i < 4; i++) {
|
||||||
|
const char* ascii = ASCII_ARRAY[i];
|
||||||
|
if(strlen(ascii) != (NUMBER_OF_LINES * LINE_SIZE)-1) {
|
||||||
|
printBug("ASCII art %d is wrong! ASCII length: %d, expected length: %d", i, strlen(ascii), (NUMBER_OF_LINES * LINE_SIZE)-1);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct ascii* art = set_ascii(get_cpu_vendor(cpu), s, cs);
|
struct ascii* art = set_ascii(get_cpu_vendor(cpu), s, cs);
|
||||||
if(art == NULL)
|
if(art == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user