aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/ngsniffer.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-06-28 03:58:52 +0000
committerGuy Harris <guy@alum.mit.edu>2000-06-28 03:58:52 +0000
commit352246de2f142a9c9e700054e9687125d69f5a6f (patch)
treed7e60afe0cb700db4df3c69e51f2936a38c11668 /wiretap/ngsniffer.c
parent6ea9c6aa9badb85cc7a729be7813d4a2e5749f7e (diff)
Don't reposition the random stream in "ngsniffer_open()" if there isn't
a random stream open. svn path=/trunk/; revision=2097
Diffstat (limited to 'wiretap/ngsniffer.c')
-rw-r--r--wiretap/ngsniffer.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/wiretap/ngsniffer.c b/wiretap/ngsniffer.c
index f546f72de2..14bb13da29 100644
--- a/wiretap/ngsniffer.c
+++ b/wiretap/ngsniffer.c
@@ -1,6 +1,6 @@
/* ngsniffer.c
*
- * $Id: ngsniffer.c,v 1.45 2000/06/15 06:18:32 guy Exp $
+ * $Id: ngsniffer.c,v 1.46 2000/06/28 03:58:52 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -403,15 +403,16 @@ int ngsniffer_open(wtap *wth, int *err)
return -1;
/*
- * Now position the random stream to the same location, which
- * should be the beginning of the real data, and should
- * be the beginning of the compressed data.
+ * Now, if we have a random stream open, position it to the same
+ * location, which should be the beginning of the real data, and
+ * should be the beginning of the compressed data.
*
* XXX - will we see any records other than REC_FRAME2, REC_FRAME4,
* or REC_EOF after this? If not, we can get rid of the loop in
* "ngsniffer_read()".
*/
- file_seek(wth->random_fh, wth->data_offset, SEEK_SET);
+ if (wth->random_fh != NULL)
+ file_seek(wth->random_fh, wth->data_offset, SEEK_SET);
/* This is a ngsniffer file */
wth->capture.ngsniffer = g_malloc(sizeof(ngsniffer_t));