From beed2793fa439f13eedfad6ff351dd44509de777 Mon Sep 17 00:00:00 2001 From: Lucas Pimentel Date: Mon, 29 Oct 2018 16:56:01 -0400 Subject: [PATCH] cast BYTE to int so hex works correctly (#180) cast BYTE to int so hex encoding works correctly --- src/Datadog.Trace.ClrProfiler.Native/integration.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Datadog.Trace.ClrProfiler.Native/integration.h b/src/Datadog.Trace.ClrProfiler.Native/integration.h index eb7939837986..79011294ccb6 100644 --- a/src/Datadog.Trace.ClrProfiler.Native/integration.h +++ b/src/Datadog.Trace.ClrProfiler.Native/integration.h @@ -37,7 +37,7 @@ struct PublicKey { inline WSTRING str() const { std::stringstream ss; for (int i = 0; i < kPublicKeySize; i++) { - ss << std::setfill('0') << std::setw(2) << std::hex << data[i]; + ss << std::setfill('0') << std::setw(2) << std::hex << static_cast(data[i]); } return ToWSTRING(ss.str()); } @@ -133,7 +133,7 @@ struct MethodSignature { WSTRING str() const { WSTRINGSTREAM ss; for (auto& b : data) { - ss << std::hex << std::setfill('0'_W) << std::setw(2) << b; + ss << std::hex << std::setfill('0'_W) << std::setw(2) << static_cast(b); } return ss.str(); }