Fix every 81th byte was dropped in a single frame

This commit is contained in:
Dr. Bernd Donner 2024-12-06 11:01:56 +01:00 committed by Bernd Donner
parent 02164d2d2b
commit cab9e11c2e

View File

@ -695,13 +695,12 @@ QString IO::Console::hexadecimalStr(const QByteArray &data)
// Convert data to string with dump every ~80 chars // Convert data to string with dump every ~80 chars
QString str; QString str;
const int characters = 80; const int characters = 80;
for (int i = 0; i < copy.length(); ++i) for (int i = 0; i < copy.length(); i += characters)
{ {
QByteArray line; QByteArray line;
for (int j = 0; j < qMin(characters, copy.length() - i); ++j) for (int j = 0; j < qMin(characters, copy.length() - i); ++j)
line.append(copy.at(i + j)); line.append(copy.at(i + j));
i += characters;
str.append(HexDump(line.data(), line.size())); str.append(HexDump(line.data(), line.size()));
} }