mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 07:50:40 +01:00
[v0.98] Fix bug in get_str_peak_performance and always show unknown pp when freq is also unknown
This commit is contained in:
@@ -157,6 +157,7 @@ char* get_str_peak_performance(int64_t flops) {
|
|||||||
if(flops == -1) {
|
if(flops == -1) {
|
||||||
str = emalloc(sizeof(char) * (strlen(STRING_UNKNOWN) + 1));
|
str = emalloc(sizeof(char) * (strlen(STRING_UNKNOWN) + 1));
|
||||||
strncpy(str, STRING_UNKNOWN, strlen(STRING_UNKNOWN) + 1);
|
strncpy(str, STRING_UNKNOWN, strlen(STRING_UNKNOWN) + 1);
|
||||||
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 7 for digits (e.g, XXXX.XX), 7 for XFLOP/s
|
// 7 for digits (e.g, XXXX.XX), 7 for XFLOP/s
|
||||||
|
|||||||
@@ -692,6 +692,8 @@ struct frequency* get_frequency_info(struct cpuInfo* cpu) {
|
|||||||
printWarn("Read max CPU frequency from udev and got 0 MHz");
|
printWarn("Read max CPU frequency from udev and got 0 MHz");
|
||||||
freq->max = UNKNOWN_FREQ;
|
freq->max = UNKNOWN_FREQ;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
freq->max = UNKNOWN_FREQ;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user