mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-03 11:44:18 +01:00
util/register: fix crashing when value string contains non-ascii chars
We can't use RegGetValueA because RegGetValueA converts wide string to non UTF-8 string, which results in crashing when printing
This commit is contained in:
@@ -16,12 +16,12 @@ void ffDetectHostImpl(FFHostResult* host)
|
||||
|
||||
FF_HKEY_AUTO_DESTROY hKey = NULL;
|
||||
|
||||
if(!ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\BIOS", &hKey, &host->error))
|
||||
if(!ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, L"HARDWARE\\DESCRIPTION\\System\\BIOS", &hKey, &host->error))
|
||||
return;
|
||||
|
||||
ffRegReadStrbuf(hKey, "SystemProductName", &host->productName, NULL);
|
||||
ffRegReadStrbuf(hKey, "SystemFamily", &host->productFamily, NULL);
|
||||
ffRegReadStrbuf(hKey, "SystemVersion", &host->productVersion, NULL);
|
||||
ffRegReadStrbuf(hKey, "SystemSKU", &host->productSku, NULL);
|
||||
ffRegReadStrbuf(hKey, "SystemManufacturer", &host->sysVendor, NULL);
|
||||
ffRegReadStrbuf(hKey, L"SystemProductName", &host->productName, NULL);
|
||||
ffRegReadStrbuf(hKey, L"SystemFamily", &host->productFamily, NULL);
|
||||
ffRegReadStrbuf(hKey, L"SystemVersion", &host->productVersion, NULL);
|
||||
ffRegReadStrbuf(hKey, L"SystemSKU", &host->productSku, NULL);
|
||||
ffRegReadStrbuf(hKey, L"SystemManufacturer", &host->sysVendor, NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user