summaryrefslogtreecommitdiffstats
path: root/editcap.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--editcap.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/editcap.c b/editcap.c
index ef99e507..8c03af3f 100644
--- a/editcap.c
+++ b/editcap.c
@@ -1943,6 +1943,10 @@ main(int argc, char *argv[])
}
while (nstime_cmp(&rec->ts, &block_next) > 0) { /* time for the next file */
+ /* We presumably want to write the DSBs from files given
+ * on the command line to every file.
+ */
+ wtap_block_array_ref(params.dsbs_initial);
if (!wtap_dump_close(pdh, NULL, &write_err, &write_err_info)) {
cfile_close_failure_message(filename, write_err,
write_err_info);
@@ -1978,6 +1982,11 @@ main(int argc, char *argv[])
if (split_packet_count != 0) {
/* time for the next file? */
if (written_count > 0 && (written_count % split_packet_count) == 0) {
+
+ /* We presumably want to write the DSBs from files given
+ * on the command line to every file.
+ */
+ wtap_block_array_ref(params.dsbs_initial);
if (!wtap_dump_close(pdh, NULL, &write_err, &write_err_info)) {
cfile_close_failure_message(filename, write_err,
write_err_info);
@@ -2594,7 +2603,7 @@ handle_chopping(chop_t chop, wtap_packet_header *out_phdr,
if (chop.off_begin_pos > 0) {
memmove(*buf + chop.off_begin_pos,
*buf + chop.off_begin_pos + chop.len_begin,
- out_phdr->caplen - chop.len_begin);
+ out_phdr->caplen - (chop.off_begin_pos + chop.len_begin));
} else {
*buf += chop.len_begin;
}