From 6013b2dc19454a144723e53ff6d5e5e2dd66ac91 Mon Sep 17 00:00:00 2001 From: skarg Date: Mon, 23 Jul 2012 16:56:19 +0000 Subject: [PATCH] Fixed MS/TP capture utility to scan files created by other capture utilities (i.e. Johnson Controls) that don't have the fixed 65535 SNAP length in the global header. --- bacnet-stack/demo/mstpcap/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bacnet-stack/demo/mstpcap/main.c b/bacnet-stack/demo/mstpcap/main.c index e361e02d..dffa0de0 100644 --- a/bacnet-stack/demo/mstpcap/main.c +++ b/bacnet-stack/demo/mstpcap/main.c @@ -609,8 +609,8 @@ static bool test_global_header( return false; } count = fread(&snaplen, sizeof(snaplen), 1, pFile); - if ((count != 1) || (snaplen != 65535)) { - fprintf(stderr, "mstpcap: invalid length of captured packets\n"); + if (count != 1) { + fprintf(stderr, "mstpcap: unable to read SNAP length\n"); fclose(pFile); pFile = NULL; return false; @@ -823,7 +823,7 @@ int main( if (test_global_header(argv[2])) { while (read_received_packet(mstp_port)) { packet_count++; - fprintf(stderr, "\r%hu packets", packet_count); + fprintf(stderr, "\r%u packets", (unsigned)packet_count); } if (packet_count) { packet_statistics_print();