mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 00:37:23 +01:00
CPU (Windows): fix detection bug
This commit is contained in:
@@ -7,7 +7,8 @@ const char* ffDetectCPUImpl(FF_MAYBE_UNUSED const FFinstance* instance, const FF
|
||||
{
|
||||
{
|
||||
DWORD length = 0;
|
||||
if (GetLogicalProcessorInformationEx(RelationAll, NULL, &length) != ERROR_INSUFFICIENT_BUFFER)
|
||||
GetLogicalProcessorInformationEx(RelationAll, NULL, &length);
|
||||
if (length == 0)
|
||||
return "GetLogicalProcessorInformationEx(RelationAll, NULL, &length) failed";
|
||||
|
||||
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX* FF_AUTO_FREE
|
||||
|
||||
@@ -14,9 +14,13 @@ void ffPrintCPU(FFinstance* instance, FFCPUOptions* options)
|
||||
ffStrbufInit(&cpu.name);
|
||||
ffStrbufInit(&cpu.vendor);
|
||||
|
||||
ffDetectCPU(instance, options, &cpu);
|
||||
const char* error = ffDetectCPU(instance, options, &cpu);
|
||||
|
||||
if(cpu.vendor.length == 0 && cpu.name.length == 0 && cpu.coresOnline <= 1)
|
||||
if(error)
|
||||
{
|
||||
ffPrintError(instance, FF_CPU_MODULE_NAME, 0, &options->moduleArgs, "%s", error);
|
||||
}
|
||||
else if(cpu.vendor.length == 0 && cpu.name.length == 0 && cpu.coresOnline <= 1)
|
||||
{
|
||||
ffPrintError(instance, FF_CPU_MODULE_NAME, 0, &options->moduleArgs, "No CPU detected");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user