aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/wtap.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>2000-05-12 05:06:33 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>2000-05-12 05:06:33 +0000
commit4ec50578de312c9aeba540d5aba330a65e740294 (patch)
tree1ff8a6397fe5c4ee5692435e343aa142a645a1e0 /wiretap/wtap.c
parent742cb69433082121f92e8db94dc9202ad7ec35f2 (diff)
In wiretap, set err to 0 before doing anything inside wtap_loop().
Tethereal was dying on me because err was initialized to some random value. It was this section of code that would exit even if wtap_loop was successful (returned TRUE) because err was never initialized or set to anything. err = load_cap_file(&cf, out_file_type); if (err != 0) { dissect_cleanup(); exit(2); } <BIGGER sheepish grin> Fixed even more errors in LLC dissector. I had inadvertantly used the wrong tvbuff_t* when calling dissect_data_tvb(). There is no way we are going to be successful in this tvbuff conversion w/o regression testing. I'm working on setting up a simple Makefile for regression testing tonight. That's why I'm finding so many bugs in my LLC conversion. </BIGGER sheepish grin> svn path=/trunk/; revision=1946
Diffstat (limited to 'wiretap/wtap.c')
-rw-r--r--wiretap/wtap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/wiretap/wtap.c b/wiretap/wtap.c
index 406dc2326b..d541af4669 100644
--- a/wiretap/wtap.c
+++ b/wiretap/wtap.c
@@ -1,6 +1,6 @@
/* wtap.c
*
- * $Id: wtap.c,v 1.39 2000/04/08 00:33:04 sharpe Exp $
+ * $Id: wtap.c,v 1.40 2000/05/12 05:06:33 gram Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -212,6 +212,9 @@ int wtap_loop(wtap *wth, int count, wtap_handler callback, u_char* user,
{
int data_offset, loop = 0;
+ /* Start be clearing error flag */
+ *err = 0;
+
while ((data_offset = wth->subtype_read(wth, err)) > 0) {
callback(user, &wth->phdr, data_offset,
buffer_start_ptr(wth->frame_buffer));