Skip to content

Commit 817bdab

Browse files
committed
hex and handles: Replace magic numbers.
1 parent 3fea49d commit 817bdab

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/common/hex_and_handles.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
std::string Uint64ToHexString(uint64_t val) {
3333
std::ostringstream oss;
3434
oss << "0x";
35-
oss << std::hex << std::setw(16) << std::setfill('0') << val;
35+
oss << std::hex << std::setw(sizeof(val) * 2) << std::setfill('0') << val;
3636
return oss.str();
3737
}
3838

3939
std::string Uint32ToHexString(uint32_t val) {
4040
std::ostringstream oss;
4141
oss << "0x";
42-
oss << std::hex << std::setw(8) << std::setfill('0') << val;
42+
oss << std::hex << std::setw(sizeof(val) * 2) << std::setfill('0') << val;
4343
return oss.str();
4444
}

0 commit comments

Comments
 (0)