Skip to content
Snippets Groups Projects
Commit 28c81e92 authored by Nat Goodspeed's avatar Nat Goodspeed
Browse files

Fix LLMachineID::getUniqueID() LL_DEBUGS log output.

getUniqueID() was logging six somewhat random bytes as garbage characters.
Change to produce a hex string instead.
parent 2a00ad07
No related branches found
No related tags found
No related merge requests found
...@@ -252,7 +252,18 @@ S32 LLMachineID::getUniqueID(unsigned char *unique_id, size_t len) ...@@ -252,7 +252,18 @@ S32 LLMachineID::getUniqueID(unsigned char *unique_id, size_t len)
if (has_static_unique_id) if (has_static_unique_id)
{ {
memcpy ( unique_id, &static_unique_id, len); memcpy ( unique_id, &static_unique_id, len);
LL_DEBUGS("AppInit") << "UniqueID: " << unique_id[0] << unique_id[1]<< unique_id[2] << unique_id[3] << unique_id[4] << unique_id [5] << LL_ENDL; LL_DEBUGS("AppInit") << "UniqueID: 0x";
// Code between here and LL_ENDL is not executed unless the LL_DEBUGS
// actually produces output
for (size_t i = 0; i < len; ++i)
{
// Copy each char to unsigned int to hexify. Sending an unsigned
// char to a std::ostream tries to represent it as a char, not
// what we want here.
unsigned byte = unique_id[i];
LL_CONT << std::hex << std::setw(2) << std::setfill('0') << byte;
}
LL_ENDL;
return 1; return 1;
} }
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment