aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/visual.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-03-05 08:40:27 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-03-05 08:40:27 +0000
commit6a5b1c2de1aafe74c901200135839a32151b3257 (patch)
tree2c75bbaa81b557864090331ad07e44813683b7ea /wiretap/visual.c
parentba95ac6c6e371b82f1f91eef869c91b097510ec7 (diff)
Make "wtap_seek_read()" return TRUE on success and FALSE on error, like
"wtap_read()". Add some additional error checks to the Sniffer file reader. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4875 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'wiretap/visual.c')
-rw-r--r--wiretap/visual.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/wiretap/visual.c b/wiretap/visual.c
index dcb11910dd..faa5a99084 100644
--- a/wiretap/visual.c
+++ b/wiretap/visual.c
@@ -2,7 +2,7 @@
* File read and write routines for Visual Networks cap files.
* Copyright (c) 2001, Tom Nisbet tnisbet@visualnetworks.com
*
- * $Id: visual.c,v 1.4 2002/03/05 05:58:41 guy Exp $
+ * $Id: visual.c,v 1.5 2002/03/05 08:39:29 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -114,7 +114,7 @@ struct visual_write_info
/* Local functions to handle file reads and writes */
static gboolean visual_read(wtap *wth, int *err, long *data_offset);
static void visual_close(wtap *wth);
-static int visual_seek_read(wtap *wth, long seek_off,
+static gboolean visual_seek_read(wtap *wth, long seek_off,
union wtap_pseudo_header *pseudo_header, u_char *pd, int packet_size,
int *err);
static gboolean visual_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr,
@@ -328,7 +328,7 @@ static void visual_close(wtap *wth)
/* Read packet data for random access.
This gets the packet data and rebuilds the pseudo header so that
the direction flag works. */
-static int visual_seek_read (wtap *wth, long seek_off,
+static gboolean visual_seek_read (wtap *wth, long seek_off,
union wtap_pseudo_header *pseudo_header, guint8 *pd, int len, int *err)
{
struct visual_pkt_hdr vpkt_hdr;
@@ -340,7 +340,7 @@ static int visual_seek_read (wtap *wth, long seek_off,
if (file_seek(wth->random_fh, seek_off - sizeof(struct visual_pkt_hdr),
SEEK_SET) == -1) {
*err = file_error(wth->random_fh);
- return -1;
+ return FALSE;
}
/* Read the packet header to get the status flags. */
@@ -350,7 +350,7 @@ static int visual_seek_read (wtap *wth, long seek_off,
*err = file_error(wth->random_fh);
if (*err == 0)
*err = WTAP_ERR_SHORT_READ;
- return -1;
+ return FALSE;
}
/* Read the packet data. */
@@ -359,7 +359,7 @@ static int visual_seek_read (wtap *wth, long seek_off,
if (bytes_read != len) {
if (*err == 0)
*err = WTAP_ERR_SHORT_READ;
- return -1;
+ return FALSE;
}
/* Set status flags. The only status currently supported for all
@@ -380,7 +380,7 @@ static int visual_seek_read (wtap *wth, long seek_off,
break;
}
- return 0;
+ return TRUE;
}