diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2009-06-02 17:22:40 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2009-06-02 17:22:40 +0000 |
commit | fa71489b83975379cf77751d9d8718d8ac2e31be (patch) | |
tree | 94fbc310e8a4d2d9b7aef47c2fef735d5db0bdb1 /editcap.c | |
parent | 7e6d072ce79222cf25e7750a7a980d8cbd070de5 (diff) | |
download | wireshark-fa71489b83975379cf77751d9d8718d8ac2e31be.tar.gz wireshark-fa71489b83975379cf77751d9d8718d8ac2e31be.tar.bz2 wireshark-fa71489b83975379cf77751d9d8718d8ac2e31be.zip |
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.
svn path=/trunk/; revision=28602
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); |