Rename "ws_version_info.h", also .c
[metze/wireshark/wip.git] / text2pcap.c
index db2360173826da666ceb35152af3991d9e3d4d88..e55fc046a3914c2e02201430ab7266bd42e77632 100644 (file)
 #include <string.h>
 #include <wsutil/file_util.h>
 #include <wsutil/crash_info.h>
-#include <ws_version_info.h>
+#include <version_info.h>
 #include <wsutil/inet_addr.h>
 
 #ifdef _WIN32
@@ -1881,7 +1881,10 @@ main(int argc, char *argv[])
 {
     int ret = EXIT_SUCCESS;
 
-    parse_options(argc, argv);
+    if (parse_options(argc, argv) != EXIT_SUCCESS) {
+        ret = EXIT_FAILURE;
+        goto clean_exit;
+    }
 
     assert(input_file  != NULL);
     assert(output_file != NULL);
@@ -1933,8 +1936,12 @@ main(int argc, char *argv[])
     }
 clean_exit:
     text2pcap_lex_destroy();
-    fclose(input_file);
-    fclose(output_file);
+    if (input_file) {
+        fclose(input_file);
+    }
+    if (output_file) {
+        fclose(output_file);
+    }
     return ret;
 }