Corrected the MS/TP capture to limit data to the input buffer.

This commit is contained in:
skarg
2008-10-27 19:53:11 +00:00
parent fb72214f83
commit 4dd074630b
4 changed files with 17 additions and 10 deletions
+2 -1
View File
@@ -156,7 +156,8 @@ static void print_received_packet(
mstp_port->SourceAddress, HI_BYTE(mstp_port->DataLength),
LO_BYTE(mstp_port->DataLength), mstp_port->HeaderCRCActual);
if (mstp_port->DataLength) {
for (i = 0; i < mstp_port->DataLength; i++) {
max_data = min(mstp_port->InputBufferSize, mstp_port->DataLength);
for (i = 0; i < max_data; i++) {
fprintf(stderr, "%02X ", mstp_port->InputBuffer[i]);
}
fprintf(stderr, "%02X %02X ", mstp_port->DataCRCActualMSB,