MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / util_output_bytes

Function util_output_bytes

src/core/codeconvert.cpp:81–101  ·  view source on GitHub ↗

has a maximum of 512 chars of output

Source from the content-addressed store, hash-verified

79
80// has a maximum of 512 chars of output
81std::string util_output_bytes(void* p, size_t n)
82{
83 std::ostringstream ss;
84 ss.imbue(std::locale::classic());
85 ss.setf(std::ios_base::hex, std::ios_base::basefield);
86
87 for (size_t i = 0; i < n; i++)
88 {
89 ss.width(2);
90 ss << toupper(tss::util::char_to_size(((char*)p)[i])) << " ";
91 }
92
93 std::string s = ss.str();
94 if (s.length() > 512)
95 {
96 s = "truncated output: " + s;
97 s.resize(512);
98 }
99
100 return s;
101}
102
103iCodeConverter* iCodeConverter::GetInstance()
104{

Callers 3

tss_ReverseConvertFunction · 0.85
codeconvert.cppFile · 0.85
ConvertMethod · 0.85

Calls 3

char_to_sizeFunction · 0.85
lengthMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected