mirror of
https://github.com/Serial-Studio/Serial-Studio.git
synced 2025-01-31 17:42:55 +08:00
Fix every 81th byte was dropped in a single frame
This commit is contained in:
parent
02164d2d2b
commit
cab9e11c2e
@ -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()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user