aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2010-07-16 18:20:32 +0000
committerGerald Combs <gerald@wireshark.org>2010-07-16 18:20:32 +0000
commitcfa9982492fe1f7b1e0dc2c0ec7ab36d4b02ee3a (patch)
treec4f0557d5b5875e0b9637d857a9cdf3421c04da4 /file.c
parentb3f57106d4b367450342808521a56e653c91371f (diff)
Make sure we call wtap_cleareof() before each read.
svn path=/trunk/; revision=33555
Diffstat (limited to 'file.c')
-rw-r--r--file.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/file.c b/file.c
index 1c5519f379..c3ca81dcc2 100644
--- a/file.c
+++ b/file.c
@@ -800,8 +800,11 @@ cf_continue_tail(capture_file *cf, volatile int to_read, int *err)
/*g_log(NULL, G_LOG_LEVEL_MESSAGE, "cf_continue_tail: %u new: %u", cf->count, to_read);*/
- wtap_cleareof(cf->wth);
- while (to_read != 0 && (wtap_read(cf->wth, err, &err_info, &data_offset))) {
+ while (to_read != 0) {
+ wtap_cleareof(cf->wth);
+ if (!wtap_read(cf->wth, err, &err_info, &data_offset)) {
+ break;
+ }
if (cf->state == FILE_READ_ABORTED) {
/* Well, the user decided to exit Wireshark. Break out of the
loop, and let the code below (which is called even if there