aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/lanalyzer.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-10-07 12:49:14 -0700
committerGuy Harris <guy@alum.mit.edu>2014-10-07 19:50:08 +0000
commit71550ba98a38508ae90df43bddd0644b2df2f717 (patch)
tree32705bb55493a9bbef53a9683d08d5170f71446e /wiretap/lanalyzer.c
parentd98debe6d04e3b2a07c8c9a03ad3a4de54ccbc27 (diff)
Make the code a bit more like the pre-new-APIs code.
Change-Id: I40282d8825936d24480c9b77e2e7d9374b1de6b5 Reviewed-on: https://code.wireshark.org/review/4534 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/lanalyzer.c')
-rw-r--r--wiretap/lanalyzer.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/wiretap/lanalyzer.c b/wiretap/lanalyzer.c
index 7fdbd4610f..70b0403cdd 100644
--- a/wiretap/lanalyzer.c
+++ b/wiretap/lanalyzer.c
@@ -313,14 +313,9 @@ int lanalyzer_open(wtap *wth, int *err, gchar **err_info)
}
if (!wtap_read_bytes(wth->fh, &header_fixed, sizeof header_fixed,
err, err_info)) {
- if (*err == WTAP_ERR_SHORT_READ) {
- /*
- * Not enough bytes for the fixed-length part of
- * the header, so not a LANAlyzer file.
- */
- return 0;
- }
- return -1;
+ if (*err != WTAP_ERR_SHORT_READ)
+ return -1;
+ return 0;
}
record_length -= sizeof header_fixed;
@@ -329,14 +324,9 @@ int lanalyzer_open(wtap *wth, int *err, gchar **err_info)
comment = (char *)g_malloc(record_length + 1);
if (!wtap_read_bytes(wth->fh, comment, record_length,
err, err_info)) {
- if (*err == WTAP_ERR_SHORT_READ) {
- /*
- * Not enough bytes for the rest of the
- * record, so not a LANAlyzer file.
- */
- return 0;
- }
- return -1;
+ if (*err != WTAP_ERR_SHORT_READ)
+ return -1;
+ return 0;
}
comment[record_length] = '\0';
wth->shb_hdr.opt_comment = comment;