diff --git a/src/dump.c b/src/dump.c index aa91458..5693c10 100644 --- a/src/dump.c +++ b/src/dump.c @@ -85,7 +85,8 @@ void dump_init(void) /* count existing records */ while (read_write(daemon->dumpfd, (void *)&pcap_header, sizeof(pcap_header), RW_READ)) { - lseek(daemon->dumpfd, pcap_header.incl_len, SEEK_CUR); + if (lseek(daemon->dumpfd, pcap_header.incl_len, SEEK_CUR) == (off_t)-1) + break; packet_count++; } }