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 <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2015-12-21 14:01:22 -08:00
parent a3e80157c8
commit 6f61a85267
1 changed files with 0 additions and 29 deletions

View File

@ -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)