Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1297,8 +1297,8 @@ std::string GDBRemoteCommunication::ExpandRLE(std::string packet) {
// Reserve enough byte for the most common case (no RLE used).
std::string decoded;
decoded.reserve(packet.size());
for (std::string::const_iterator c = packet.begin(); c != packet.end(); ++c) {
if (*c == '*') {
for (std::string::const_iterator c = packet.begin(); c != packet.end();) {
if (*c == '*' && std::next(c) != packet.end()) {
// '*' indicates RLE. Next character will give us the repeat count and
// previous character is what is to be repeated.
char char_to_repeat = decoded.back();
Expand All @@ -1316,6 +1316,7 @@ std::string GDBRemoteCommunication::ExpandRLE(std::string packet) {
} else {
decoded.push_back(*c);
}
c++;
}
return decoded;
}