aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/tnef.c
diff options
context:
space:
mode:
Diffstat (limited to 'wiretap/tnef.c')
-rw-r--r--wiretap/tnef.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/wiretap/tnef.c b/wiretap/tnef.c
index f7772509d0..1ab28e2bb0 100644
--- a/wiretap/tnef.c
+++ b/wiretap/tnef.c
@@ -37,17 +37,20 @@
static gboolean tnef_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset)
{
+ gint64 offset;
guint8 *buf;
gint64 file_size;
int packet_size;
*err = 0;
+ offset = file_tell(wth->fh);
+
/* there is only ever one packet */
- if(wth->data_offset)
+ if (offset)
return FALSE;
- *data_offset = wth->data_offset;
+ *data_offset = offset;
if ((file_size = wtap_file_size(wth, err)) == -1)
return FALSE;
@@ -69,8 +72,6 @@ static gboolean tnef_read(wtap *wth, int *err, gchar **err_info, gint64 *data_of
wtap_file_read_expected_bytes(buf, packet_size, wth->fh, err, err_info);
- wth->data_offset += packet_size;
-
wth->phdr.presence_flags = 0; /* no time stamp, no "real length" */
wth->phdr.caplen = packet_size;