Fix decoding of USB or FireWire serial numbers with control characters.

This commit is contained in:
2021-07-24 20:02:44 +01:00
parent 4570055ff9
commit 3082b53261

View File

@@ -902,7 +902,7 @@ namespace Aaru.Devices
Serial = UsbSerialString;
else
foreach(char c in Serial.Where(c => !char.IsControl(c)))
Serial = $"{(uint)c:X2}";
Serial = $"{Serial}{(uint)c:X2}";
}
if(IsFireWire)
@@ -917,7 +917,7 @@ namespace Aaru.Devices
Serial = $"{_firewireGuid:X16}";
else
foreach(char c in Serial.Where(c => !char.IsControl(c)))
Serial = $"{(uint)c:X2}";
Serial = $"{Serial}{(uint)c:X2}";
}
// Some optical drives are not getting the correct serial, and IDENTIFY PACKET DEVICE is blocked without