Fixed crash (getUInt takes m_current_offset into account, which made

the indices partially invalid).
This commit is contained in:
hiker 2016-02-26 09:20:13 +11:00
parent 8621437e07
commit 5c32cbe1be

View File

@ -130,15 +130,15 @@ std::string BareNetworkString::getLogMessage() const
unsigned int upper_limit = std::min(line+16, size()); unsigned int upper_limit = std::min(line+16, size());
for(unsigned int i=line; i<upper_limit; i++) for(unsigned int i=line; i<upper_limit; i++)
{ {
oss << getUInt8(i); oss << m_buffer[i];
if(i%2==1) oss << " "; if(i%2==1) oss << " ";
} // for i } // for i
// Add ascii representation // Add ascii representation
for(unsigned int i=line; i<upper_limit; i++) for(unsigned int i=line; i<upper_limit; i++)
{ {
uint8_t c = getUInt8(i); uint8_t c = m_buffer[i];
if(isprint(c)) if(isprint(c))
oss << char(getUInt8(i)); oss << char(c);
else else
oss << '.'; oss << '.';
} // for i } // for i