Merge pull request #358 from inkdot7/decimal_busdev

Parse USB bus:dev as decimal integers, to be consistent with `--scan-usb`.
This commit is contained in:
Gwenhael Goavec-Merou 2023-07-29 18:10:48 +02:00 committed by GitHub
commit baeb9d52ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -895,9 +895,9 @@ int parse_opt(int argc, char **argv, struct arguments *args,
}
try {
args->bus_addr = static_cast<uint8_t>(std::stoi(bus_dev_num[0],
nullptr, 16));
nullptr, 10));
args->device_addr = static_cast<uint8_t>(
std::stoi(bus_dev_num[1], nullptr, 16));
std::stoi(bus_dev_num[1], nullptr, 10));
} catch (std::exception &e) {
printError("Error: busdev-num invalid format: must be numeric values");
throw std::exception();