aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/peektagged.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-09-28 21:35:12 -0700
committerGuy Harris <guy@alum.mit.edu>2016-09-29 04:35:48 +0000
commite91af83c637adaa7a9837de65f50596a32b08db0 (patch)
tree0c18941d92ae6ec9274f9035dfc26ed369e11572 /wiretap/peektagged.c
parent48b641576c53e9c7cef2e9487669460a975a0c0d (diff)
Replace some seeks forward with wtap_read_bytes() with a null buffer pointer.
If the seek forward is just skipping record content that's not (currently) interesting, use wtap_read_bytes() with a null buffer pointer; it catches short "reads" and requires less seeking, so it may work better when reading from a pipe. Change-Id: Ifb07d20e0391a8ed97da85149d971b4e9ef093a8 Reviewed-on: https://code.wireshark.org/review/17976 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/peektagged.c')
-rw-r--r--wiretap/peektagged.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/wiretap/peektagged.c b/wiretap/peektagged.c
index 6d46e26fa9..943ca0e058 100644
--- a/wiretap/peektagged.c
+++ b/wiretap/peektagged.c
@@ -372,8 +372,9 @@ wtap_open_return_val peektagged_open(wtap *wth, int *err, gchar **err_info)
}
/* skip 8 zero bytes */
- if (file_seek (wth->fh, 8L, SEEK_CUR, err) == -1)
- return WTAP_OPEN_NOT_MINE;
+ if (!wtap_read_bytes (wth->fh, NULL, 8, err, err_info)) {
+ return WTAP_OPEN_ERROR;
+ }
/*
* This is an Peek tagged file.