Correct loss of sync protocol error #787

This commit is contained in:
Stoyan Shopov 2020-12-03 21:03:57 +02:00 committed by UweBonnes
parent e3fd12ebc6
commit c9a419e44b
1 changed files with 6 additions and 0 deletions

View File

@ -81,6 +81,12 @@ int gdb_getpacket(char *packet, int size)
break;
}
}
/* Reset the packet buffer start character to zero, because function
* 'remotePacketProcess()' above overwrites this buffer, and
* an arbitrary character may have been placed there. If this is a '$'
* character, this will cause this loop to be terminated, which is wrong.
*/
packet[0] = 0;
}
#endif
} while (packet[0] != '$');