aboutsummaryrefslogtreecommitdiffstats
path: root/merge.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-05-25 18:50:47 +0000
committerGuy Harris <guy@alum.mit.edu>2012-05-25 18:50:47 +0000
commitce9bd398931417602c5884019923f71b7dee4391 (patch)
treec21bb9643368370f3019491e83d71068144a14ab /merge.c
parent3e24d3bbce6d0508901c99fcbc65865b5e5eec5d (diff)
On a read error, always return a pointer to the merge_in_file_t for the
file from which we got the error. On a successful read, always clear out err - wtap_read() doesn't set *err on success. svn path=/trunk/; revision=42854
Diffstat (limited to 'merge.c')
-rw-r--r--merge.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/merge.c b/merge.c
index 95be037fcf..b055456830 100644
--- a/merge.c
+++ b/merge.c
@@ -184,7 +184,7 @@ merge_read_packet(int in_file_count, merge_in_file_t in_files[],
if (!wtap_read(in_files[i].wth, err, err_info, &in_files[i].data_offset)) {
if (*err != 0) {
in_files[i].state = GOT_ERROR;
- return NULL;
+ return &in_files[i];
}
in_files[i].state = AT_EOF;
} else
@@ -212,7 +212,11 @@ merge_read_packet(int in_file_count, merge_in_file_t in_files[],
/* Count this packet. */
in_files[ei].packet_num++;
- /* Return the ordinal of the file from which the packet was read. */
+ /*
+ * Return a pointer to the merge_in_file_t of the file from which the
+ * packet was read.
+ */
+ *err = 0;
return &in_files[ei];
}
@@ -257,7 +261,10 @@ merge_append_read_packet(int in_file_count, merge_in_file_t in_files[],
return NULL;
}
- /* Return the ordinal of the file from which the packet was read. */
+ /*
+ * Return a pointer to the merge_in_file_t of the file from which the
+ * packet was read.
+ */
*err = 0;
return &in_files[i];
}