From d2f7040527cf2b3d36c28ff98de97b5035d50c8f Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Sun, 28 May 2023 17:14:48 +0200 Subject: [PATCH] main: parse_opt: busdev-num: explicitly set hex base --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 56bb5dd..91c4e4a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -891,9 +891,9 @@ int parse_opt(int argc, char **argv, struct arguments *args, } try { args->bus_addr = static_cast(std::stoi(bus_dev_num[0], - nullptr, 0)); + nullptr, 16)); args->device_addr = static_cast( - std::stoi(bus_dev_num[1], nullptr, 0)); + std::stoi(bus_dev_num[1], nullptr, 16)); } catch (std::exception &e) { printError("Error: busdev-num invalid format: must be numeric values"); throw std::exception();