diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-11-25 05:58:56 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-11-25 05:58:56 +0000 |
commit | e3f791ebeae9a763fe2172d8628ddaf6a3780ff3 (patch) | |
tree | fc0fe2a1cebf033a6defa01e873b07e05453bfe3 | |
parent | 6939f62da09c9037cd9ca0d1b55c8305a442c8a2 (diff) | |
download | wireshark-e3f791ebeae9a763fe2172d8628ddaf6a3780ff3.tar.gz wireshark-e3f791ebeae9a763fe2172d8628ddaf6a3780ff3.tar.bz2 wireshark-e3f791ebeae9a763fe2172d8628ddaf6a3780ff3.zip |
"file_seek()" sets "*err" - we don't have to set it ourselves.
The same is true of "parse_cosine_rec_hdr()".
svn path=/trunk/; revision=9079
-rw-r--r-- | wiretap/cosine.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/wiretap/cosine.c b/wiretap/cosine.c index 3ad15f09c6..64e0a6395c 100644 --- a/wiretap/cosine.c +++ b/wiretap/cosine.c @@ -1,6 +1,6 @@ /* cosine.c * - * $Id: cosine.c,v 1.5 2002/08/28 20:30:44 jmayer Exp $ + * $Id: cosine.c,v 1.6 2003/11/25 05:58:56 guy Exp $ * * CoSine IPNOS L2 debug output parsing * Copyright (c) 2002 by Motonori Shindo <mshindo@mshindo.net> @@ -289,10 +289,8 @@ int cosine_open(wtap *wth, int *err) return -1; } - if (file_seek(wth->fh, 0L, SEEK_SET, err) == -1) { /* rewind */ - *err = file_error(wth->fh); + if (file_seek(wth->fh, 0L, SEEK_SET, err) == -1) /* rewind */ return -1; - } wth->data_offset = 0; wth->file_encap = WTAP_ENCAP_COSINE; @@ -343,10 +341,8 @@ cosine_seek_read (wtap *wth, long seek_off, { char line[COSINE_LINE_LENGTH]; - if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1) { - *err = file_error(wth->random_fh); + if (file_seek(wth->random_fh, seek_off, SEEK_SET, err) == -1) return FALSE; - } if (file_gets(line, COSINE_LINE_LENGTH, wth->random_fh) == NULL) { *err = file_error(wth->random_fh); @@ -356,13 +352,8 @@ cosine_seek_read (wtap *wth, long seek_off, return FALSE; } - if (parse_cosine_rec_hdr(NULL, line, pseudo_header, err) == -1) { - *err = file_error(wth->random_fh); - if (*err == 0) { - *err = WTAP_ERR_BAD_RECORD; - } + if (parse_cosine_rec_hdr(NULL, line, pseudo_header, err) == -1) return FALSE; - } return parse_cosine_hex_dump(wth->random_fh, len, pd, err); } |