diff options
author | Guy Harris <guy@alum.mit.edu> | 2012-05-25 18:50:47 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-05-25 18:50:47 +0000 |
commit | ce9bd398931417602c5884019923f71b7dee4391 (patch) | |
tree | c21bb9643368370f3019491e83d71068144a14ab /merge.c | |
parent | 3e24d3bbce6d0508901c99fcbc65865b5e5eec5d (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.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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]; } |