From 6f61a85267013babe183fdd55eb46a06df491c47 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 21 Dec 2015 14:01:22 -0800 Subject: [PATCH] Don't write out statistics if we don't have any. We don't know when the capture started or ended (the time stamps of the first and last packets aren't necessarily the time when the capture started or ended), we don't know how many packets were dropped in the capture process, and we don't know how many packets were seen in various stages before they were received by whatever software dumped them out as text, so we have no statistics to report. Change-Id: Ia8bface63a95f925a6ccb19c32d188055809f203 Reviewed-on: https://code.wireshark.org/review/12812 Reviewed-by: Guy Harris --- text2pcap.c | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/text2pcap.c b/text2pcap.c index bf16e150c5..934709d468 100644 --- a/text2pcap.c +++ b/text2pcap.c @@ -958,34 +958,6 @@ write_file_header (void) } } -static void -write_file_trailer (void) -{ - int err; - gboolean success; - - if (use_pcapng) { - success = pcapng_write_interface_statistics_block(output_file, - 0, - &bytes_written, - "Counters provided by text2pcap", - 0, - 0, - num_packets_written, - 0, - &err); - - } else { - success = TRUE; - } - if (!success) { - fprintf(stderr, "File write error [%s] : %s\n", - output_filename, g_strerror(err)); - exit(1); - } - return; -} - /*---------------------------------------------------------------------- * Append a token to the packet preamble. */ @@ -1948,7 +1920,6 @@ main(int argc, char *argv[]) yylex(); write_current_packet(FALSE); - write_file_trailer(); fclose(input_file); fclose(output_file); if (debug)