diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-04-04 18:56:27 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-04-05 02:49:43 +0000 |
commit | 8a5b26efb14b7f8f5375383436f03108d52d9aed (patch) | |
tree | eb57791fc53deab1c618b259e11092f122a8ee97 /ui/file_dialog.c | |
parent | b572b65e518937f43b630991c07369d8e0c79f53 (diff) |
Have wtap_read() fill in a wtap_rec and Buffer.
That makes it - and the routines that implement it - work more like the
seek-read routine.
Change-Id: I0cace2d0e4c9ebfc21ac98fd1af1ec70f60a240d
Reviewed-on: https://code.wireshark.org/review/32727
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/file_dialog.c')
-rw-r--r-- | ui/file_dialog.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ui/file_dialog.c b/ui/file_dialog.c index 34c71c349d..b80fba4cd3 100644 --- a/ui/file_dialog.c +++ b/ui/file_dialog.c @@ -27,7 +27,8 @@ get_stats_for_preview(wtap *wth, ws_file_preview_stats *stats, int *err, gchar **err_info) { gint64 data_offset; - const wtap_rec *rec; + wtap_rec rec; + Buffer buf; guint32 records; guint32 data_records; double start_time; @@ -44,10 +45,9 @@ get_stats_for_preview(wtap *wth, ws_file_preview_stats *stats, data_records = 0; timed_out = FALSE; time(&time_preview); - while ((wtap_read(wth, err, err_info, &data_offset))) { - rec = wtap_get_rec(wth); - if (rec->presence_flags & WTAP_HAS_TS) { - cur_time = nstime_to_sec(&rec->ts); + while ((wtap_read(wth, &rec, &buf, err, err_info, &data_offset))) { + if (rec.presence_flags & WTAP_HAS_TS) { + cur_time = nstime_to_sec(&rec.ts); if (!have_times) { start_time = cur_time; stop_time = cur_time; @@ -61,7 +61,7 @@ get_stats_for_preview(wtap *wth, ws_file_preview_stats *stats, } } - switch (rec->rec_type) { + switch (rec.rec_type) { case REC_TYPE_PACKET: case REC_TYPE_FT_SPECIFIC_EVENT: |