diff options
author | stig <stig@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-06-02 17:22:40 +0000 |
---|---|---|
committer | stig <stig@f5534014-38df-0310-8fa8-9805f1628bb7> | 2009-06-02 17:22:40 +0000 |
commit | 7ac9b87db2cda197c607afbfae88f7417fba4767 (patch) | |
tree | 94fbc310e8a4d2d9b7aef47c2fef735d5db0bdb1 /editcap.c | |
parent | ea14ade104869bdc8ab6528471abb5113ee1fdb0 (diff) |
Only call wtap_dump_close() if we have an open file.
We can have a situation where a file only contains a valid file header
without any packages, so this will avoid a crash.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28602 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'editcap.c')
-rw-r--r-- | editcap.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1250,9 +1250,9 @@ main(int argc, char *argv[]) } } - if (!wtap_dump_close(pdh, &err)) { + if (pdh && !wtap_dump_close(pdh, &err)) { - fprintf(stderr, "editcap: Error writing to %s: %s\n", filename, + fprintf(stderr, "editcap: Error closing %s: %s\n", filename, wtap_strerror(err)); exit(2); |