Merge pull request #231 from PartialVolume/Fix_duplicated_serial_no

Fix duplicated serial number
This commit is contained in:
PartialVolume
2020-03-24 23:12:29 +00:00
committed by GitHub

View File

@@ -186,11 +186,12 @@ int check_device( nwipe_context_t*** c, PedDevice* dev, int dcount )
trim( (char*) next_device->device_serial_no );
/* if we couldn't obtain serial number by using the above method .. this this */
nwipe_get_device_bus_type_and_serialno( next_device->device_name, &next_device->device_type, tmp_serial );
if( next_device->device_serial_no[0] == 0 )
if( nwipe_get_device_bus_type_and_serialno( next_device->device_name, &next_device->device_type, tmp_serial ) == 0 )
{
strcpy( next_device->device_serial_no, tmp_serial );
if( next_device->device_serial_no[0] == 0 )
{
strcpy( next_device->device_serial_no, tmp_serial );
}
}
switch( next_device->device_type )