Skip to content

Commit 331d831

Browse files
author
Avi SZYCHTER
committed
Let the standard library choose the base for detail ID
1 parent bd03d16 commit 331d831

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

utils/can-parse/can-parse.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,7 @@ std::tuple<CanParseAction, std::string, uint32_t> extractAction(int argc, char**
7777
check_args = false;
7878

7979
try {
80-
if(arg.compare(0, 2, "0x") == 0 || arg.compare(0, 2, "0X") == 0) {
81-
detail_frame = std::stoul(arg, nullptr, 16);
82-
}
83-
else {
84-
detail_frame = std::stoul(arg);
85-
}
86-
80+
detail_frame = std::stoul(arg, nullptr, 0);
8781
action = static_cast<CanParseAction>(static_cast<int>(action) + 1);
8882
continue;
8983
} catch(const std::logic_error& e) {

0 commit comments

Comments
 (0)