diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-07-24 16:27:34 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-07-24 16:27:34 +0000 |
commit | 2e0d26f22b3d60d0950e09e0605da5847f8b1a89 (patch) | |
tree | 4df24b405dd959e6dd49c85d76fc0f1c53b7b1da /tethereal.c | |
parent | 401fd7867275e0c4ac57b401e72f0a003e41d67d (diff) | |
download | wireshark-2e0d26f22b3d60d0950e09e0605da5847f8b1a89.tar.gz wireshark-2e0d26f22b3d60d0950e09e0605da5847f8b1a89.tar.bz2 wireshark-2e0d26f22b3d60d0950e09e0605da5847f8b1a89.zip |
Correct packet count displayed while capturing with -w option. (there was
an extra increment of cfile.count).
Print a newline to stdout at the end of a capture with "-w" so that the
final packet count isn't obliterated by the shell prompt.
svn path=/trunk/; revision=2156
Diffstat (limited to 'tethereal.c')
-rw-r--r-- | tethereal.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tethereal.c b/tethereal.c index 7adcca4486..c5d1ac63d1 100644 --- a/tethereal.c +++ b/tethereal.c @@ -1,6 +1,6 @@ /* tethereal.c * - * $Id: tethereal.c,v 1.36 2000/07/20 09:39:23 guy Exp $ + * $Id: tethereal.c,v 1.37 2000/07/24 16:27:34 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -590,6 +590,11 @@ capture(int packet_count, int out_file_type) inpkts = pcap_loop(ld.pch, packet_count, capture_pcap_cb, (u_char *) &ld); pcap_close(ld.pch); + /* Send a newline if we were printing packet counts to stdout */ + if (cfile.save_file != NULL) { + printf("\n"); + } + return TRUE; error: @@ -620,7 +625,6 @@ capture_pcap_cb(u_char *user, const struct pcap_pkthdr *phdr, args.pdh = ld->pdh; if (ld->pdh) { wtap_dispatch_cb_write((u_char *)&args, &whdr, 0, NULL, pd); - cfile.count++; printf("\r%u ", cfile.count); fflush(stdout); } else { |