mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Drivers: Ensure serial numbers are uppercase
This prevents mismatches if the device sends a lowercase serial number, which may happen due to an oversight in production.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <cwctype>
|
||||
#include <algorithm>
|
||||
#include <codecvt>
|
||||
#include <cctype>
|
||||
#include <limits>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -152,6 +153,8 @@ void VCP::Find(std::vector<FoundDevice>& found, std::vector<std::wstring> driver
|
||||
if(serial.find_first_of('\\') != std::string::npos)
|
||||
continue;
|
||||
}
|
||||
for(char& c : serial)
|
||||
c = static_cast<char>(toupper(c));
|
||||
strcpy_s(device.serial, sizeof(device.serial), serial.c_str());
|
||||
|
||||
// Serial number is saved, we want the COM port number now
|
||||
|
||||
Reference in New Issue
Block a user