Correctly handle GPU names with multiple ']'

This commit is contained in:
Linus Dierheimer
2022-09-09 17:48:55 +02:00
parent 425e135bd8
commit 126c1a10bb
+1 -2
View File
@@ -90,8 +90,7 @@ static void pciDetectDeviceName(FFGPUResult* gpu, PCIData* pci, struct pci_dev*
ffStrbufRecalculateLength(&gpu->name);
uint32_t openingBracket = ffStrbufFirstIndexC(&gpu->name, '[');
uint32_t closingBracket = ffStrbufFirstIndexC(&gpu->name, ']');
uint32_t closingBracket = ffStrbufLastIndexC(&gpu->name, ']');
if(openingBracket < closingBracket && closingBracket < gpu->name.length)
{
ffStrbufSubstrBefore(&gpu->name, closingBracket);