aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/cosine.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-06-17 21:18:47 +0000
committerGuy Harris <guy@alum.mit.edu>2013-06-17 21:18:47 +0000
commit32b95570df10da14e9662ac91974e89156221e10 (patch)
treed2de0f4835972269368035a2da153ed500a61444 /wiretap/cosine.c
parent20de5f1a9a7d245887fa0e95bd9ef3dfbb8166bc (diff)
Merge "read record header" and "read packet data" routines into a single
routine, used both by read and seek-read routines. svn path=/trunk/; revision=49988
Diffstat (limited to 'wiretap/cosine.c')
-rw-r--r--wiretap/cosine.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/wiretap/cosine.c b/wiretap/cosine.c
index 117e4b8069..48fdb5b788 100644
--- a/wiretap/cosine.c
+++ b/wiretap/cosine.c
@@ -315,8 +315,9 @@ static gboolean cosine_read(wtap *wth, int *err, gchar **err_info,
/* Used to read packets in random-access fashion */
static gboolean
cosine_seek_read (wtap *wth, gint64 seek_off, struct wtap_pkthdr *phdr,
- Buffer *buf, int len, int *err, gchar **err_info)
+ Buffer *buf, int len _U_, int *err, gchar **err_info)
{
+ int pkt_len;
char line[COSINE_LINE_LENGTH];
if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1)
@@ -330,11 +331,13 @@ cosine_seek_read (wtap *wth, gint64 seek_off, struct wtap_pkthdr *phdr,
return FALSE;
}
- if (parse_cosine_rec_hdr(phdr, line, err, err_info) == -1)
+ /* Parse the header */
+ pkt_len = parse_cosine_rec_hdr(phdr, line, err, err_info);
+ if (pkt_len == -1)
return FALSE;
/* Convert the ASCII hex dump to binary data */
- return parse_cosine_hex_dump(wth->random_fh, phdr, len, buf, err,
+ return parse_cosine_hex_dump(wth->random_fh, phdr, pkt_len, buf, err,
err_info);
}