From 291c43dd31b27d36d8330ff3921de4b12db26384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Thu, 22 Jun 2023 16:55:11 +0800 Subject: [PATCH] Bios: print as `${version} (${release})` As biosRelease looks more like a version on my laptop --- src/detection/bios/bios_windows.c | 4 ++-- src/modules/bios/bios.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/detection/bios/bios_windows.c b/src/detection/bios/bios_windows.c index e23baa9c1..8d385a1df 100644 --- a/src/detection/bios/bios_windows.c +++ b/src/detection/bios/bios_windows.c @@ -7,7 +7,7 @@ const char* ffDetectBios(FFBiosResult* bios) if(!ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, L"HARDWARE\\DESCRIPTION\\System\\BIOS", &hKey, NULL)) return "ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, L\"HARDWARE\\DESCRIPTION\\System\\BIOS\", &hKey, NULL) failed"; - if(!ffRegReadStrbuf(hKey, L"BIOSVersion", &bios->biosRelease, NULL)) + if(!ffRegReadStrbuf(hKey, L"BIOSVersion", &bios->biosVersion, NULL)) return "\"HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\BIOS\\BIOSVersion\" doesn't exist"; ffRegReadStrbuf(hKey, L"BIOSVendor", &bios->biosVendor, NULL); @@ -18,7 +18,7 @@ const char* ffDetectBios(FFBiosResult* bios) ffRegReadUint(hKey, L"BiosMajorRelease", &major, NULL) && ffRegReadUint(hKey, L"BiosMinorRelease", &minor, NULL) ) - ffStrbufAppendF(&bios->biosVersion, "%u.%u", (unsigned)major, (unsigned)minor); + ffStrbufAppendF(&bios->biosRelease, "%u.%u", (unsigned)major, (unsigned)minor); return NULL; } diff --git a/src/modules/bios/bios.c b/src/modules/bios/bios.c index 8c387f372..381f4e5b8 100644 --- a/src/modules/bios/bios.c +++ b/src/modules/bios/bios.c @@ -22,18 +22,18 @@ void ffPrintBios(FFinstance* instance, FFBiosOptions* options) goto exit; } - if(bios.biosRelease.length == 0) + if(bios.biosVersion.length == 0) { - ffPrintError(instance, FF_BIOS_MODULE_NAME, 0, &options->moduleArgs, "bios_release is not set."); + ffPrintError(instance, FF_BIOS_MODULE_NAME, 0, &options->moduleArgs, "bios_version is not set."); goto exit; } if(options->moduleArgs.outputFormat.length == 0) { ffPrintLogoAndKey(instance, FF_BIOS_MODULE_NAME, 0, &options->moduleArgs.key, &options->moduleArgs.keyColor); - ffStrbufWriteTo(&bios.biosRelease, stdout); - if (bios.biosVersion.length) - printf(" (%s)", bios.biosVersion.chars); + ffStrbufWriteTo(&bios.biosVersion, stdout); + if (bios.biosRelease.length) + printf(" (%s)", bios.biosRelease.chars); putchar('\n'); } else