PhysicalMemory: clean up garbage data

This commit is contained in:
李通洲
2024-12-22 20:27:27 +08:00
parent 851f271ed5
commit 2f3861e732
2 changed files with 2 additions and 0 deletions
@@ -23,6 +23,7 @@ static inline const char* getVendorString(unsigned vendorId)
void FFPhysicalMemoryUpdateVendorString(FFPhysicalMemoryResult* device)
{
if (device->vendor.length == 0) return;
if (ffStrbufEqualS(&device->vendor, "Unknown"))
{
ffStrbufClear(&device->vendor);
@@ -191,6 +191,7 @@ const char* ffDetectPhysicalMemory(FFlist* result)
device->maxSpeed = data->Speed == 0xFFFF ? data->ExtendedSpeed : data->Speed;
ffStrbufSetStatic(&device->vendor, ffSmbiosLocateString(strings, data->Manufacturer));
ffCleanUpSmbiosValue(&device->vendor);
FFPhysicalMemoryUpdateVendorString(device);
ffStrbufSetStatic(&device->serial, ffSmbiosLocateString(strings, data->SerialNumber));