aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-12-17 20:03:47 -0800
committerGuy Harris <guy@alum.mit.edu>2014-12-18 04:04:19 +0000
commit0885d2945103236f7f475963f66048291f0b18f1 (patch)
tree2c165dd89f97ee9cc33d39f9b7a62840e0ab269b /wiretap
parent6011a047d3cd2aba84e7fdd3bf7e8403a2f3563b (diff)
Make sure err_info is always set, and print it iff it's non-null.
Change-Id: Ib5c600c491a3d8adcfa91c00fa9445283610545b Reviewed-on: https://code.wireshark.org/review/5830 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/file_access.c5
-rw-r--r--wiretap/wtap.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/wiretap/file_access.c b/wiretap/file_access.c
index c475ffd6a6..730698b919 100644
--- a/wiretap/file_access.c
+++ b/wiretap/file_access.c
@@ -726,6 +726,9 @@ wtap_open_offline(const char *filename, unsigned int type, int *err, char **err_
gboolean use_stdin = FALSE;
gchar *extension;
+ *err = 0;
+ *err_info = NULL;
+
init_open_routines();
/* open standard input if filename is '-' */
@@ -2318,6 +2321,8 @@ gboolean
wtap_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr,
const guint8 *pd, int *err, gchar **err_info)
{
+ *err = 0;
+ *err_info = NULL;
return (wdh->subtype_write)(wdh, phdr, pd, err, err_info);
}
diff --git a/wiretap/wtap.c b/wiretap/wtap.c
index 731ab26091..dd7d5aed9c 100644
--- a/wiretap/wtap.c
+++ b/wiretap/wtap.c
@@ -1050,6 +1050,8 @@ wtap_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset)
wth->phdr.pkt_encap = wth->file_encap;
wth->phdr.pkt_tsprec = wth->file_tsprec;
+ *err = 0;
+ *err_info = NULL;
if (!wth->subtype_read(wth, err, err_info, data_offset)) {
/*
* If we didn't get an error indication, we read