From 3082b53261a4e9849fbeaae815336d14234b45cc Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sat, 24 Jul 2021 20:02:44 +0100 Subject: [PATCH] Fix decoding of USB or FireWire serial numbers with control characters. --- Aaru.Devices/Device/Constructor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Aaru.Devices/Device/Constructor.cs b/Aaru.Devices/Device/Constructor.cs index e79b5acb4..2a1862b90 100644 --- a/Aaru.Devices/Device/Constructor.cs +++ b/Aaru.Devices/Device/Constructor.cs @@ -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