diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-10-15 18:15:15 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-10-16 01:17:41 +0000 |
commit | df8389559fcb99443f4e99f4fa2130329359426c (patch) | |
tree | a5035f96c8f5a20a9eddc79511ed747d7e2f5055 /wiretap | |
parent | 9cfab55200106f2eeab55bbe8fac98c27e4bfe48 (diff) | |
download | wireshark-df8389559fcb99443f4e99f4fa2130329359426c.tar.gz |
Make sure *err and *err_info are set when returning PCAPNG_BLOCK_NOT_SHB.
Clean up a comment and indentation while we're at it.
Change-Id: Ia2b0a3f642849dcd464e04cdca13ff05c2fbe2e6
Reviewed-on: https://code.wireshark.org/review/4717
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/pcapng.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c index 02afc04df9..d541ef3967 100644 --- a/wiretap/pcapng.c +++ b/wiretap/pcapng.c @@ -491,9 +491,9 @@ pcapng_free_wtapng_block_data(wtapng_block_t *wblock) } typedef enum { - PCAPNG_BLOCK_OK, - PCAPNG_BLOCK_NOT_SHB, - PCAPNG_BLOCK_ERROR + PCAPNG_BLOCK_OK, + PCAPNG_BLOCK_NOT_SHB, + PCAPNG_BLOCK_ERROR } block_return_val; static block_return_val @@ -2082,9 +2082,11 @@ pcapng_read_block(wtap *wth, FILE_T fh, pcapng_t *pn, wtapng_block_t *wblock, in if (!pn->shb_read) { /* * No SHB seen yet, so we're trying to read the first block - * during an open; if what we read isn't an SHB, this isn't - * a pcap-ng file. + * during an open, to see whether it's an SHB; if what we + * read doesn't look like an SHB, this isn't a pcap-ng file. */ + *err = 0; + *err_info = NULL; return PCAPNG_BLOCK_NOT_SHB; } switch (bh.block_type) { |