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:
commit
baeb9d52ec
|
|
@ -895,9 +895,9 @@ int parse_opt(int argc, char **argv, struct arguments *args,
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
args->bus_addr = static_cast<uint8_t>(std::stoi(bus_dev_num[0],
|
args->bus_addr = static_cast<uint8_t>(std::stoi(bus_dev_num[0],
|
||||||
nullptr, 16));
|
nullptr, 10));
|
||||||
args->device_addr = static_cast<uint8_t>(
|
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) {
|
} catch (std::exception &e) {
|
||||||
printError("Error: busdev-num invalid format: must be numeric values");
|
printError("Error: busdev-num invalid format: must be numeric values");
|
||||||
throw std::exception();
|
throw std::exception();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue