diff options
author | Sake Blok <sake@euronet.nl> | 2008-02-15 13:02:43 +0000 |
---|---|---|
committer | Sake Blok <sake@euronet.nl> | 2008-02-15 13:02:43 +0000 |
commit | b38b10b51601e719622fe3e55e3c1fba21a1f8ec (patch) | |
tree | 6f8d2a1c60d253aa7cf3ac799ac4ebeaeac83653 /tshark.c | |
parent | 0d0d86cc579311cc33884cfbbed98e109bdde3d8 (diff) |
Make -c work properly in tshark when a read filter is used.
svn path=/trunk/; revision=24335
Diffstat (limited to 'tshark.c')
-rw-r--r-- | tshark.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -2256,10 +2256,11 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type, } } /* Stop reading if we have the maximum number of packets; - * note that a zero max_packet_count will never be matched - * (unless we roll over the packet number?) + * When the -c option has not been used, max_packet_count + * starts at 0, which practically means, never stop reading. + * (unless we roll over max_packet_count ?) */ - if(max_packet_count == cf->count || (max_byte_count != 0 && data_offset >= max_byte_count)) { + if( (--max_packet_count == 0) || (max_byte_count != 0 && data_offset >= max_byte_count)) { err = 0; /* This is not an error */ break; } |