mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 16:00:39 +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 \
|
||||
@@ -86,4 +88,11 @@
|
||||
\
|
||||
"
|
||||
|
||||
static const char* ASCII_ARRAY [] = {
|
||||
AMD_ASCII,
|
||||
INTEL_ASCII,
|
||||
ARM_ASCII,
|
||||
UNKNOWN_ASCII
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -641,6 +641,15 @@ bool print_cpufetch_arm(struct ascii* art, struct cpuInfo* cpu, struct cache* ca
|
||||
#endif
|
||||
|
||||
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);
|
||||
if(art == NULL)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user