diff --git a/captype.c b/captype.c index 5204007875..6a0098788f 100644 --- a/captype.c +++ b/captype.c @@ -133,18 +133,15 @@ main(int argc, char *argv[]) case 'h': show_help_header("Print the file types of capture files."); print_usage(stdout); - exit(0); - break; + return EXIT_SUCCESS; case 'v': show_version(); - exit(0); - break; + return EXIT_SUCCESS; case '?': /* Bad flag - print usage message */ print_usage(stderr); - exit(1); - break; + return EXIT_FAILURE; } } diff --git a/epan/dtd.h b/epan/dtd.h index f835e54fba..eefcfbae36 100644 --- a/epan/dtd.h +++ b/epan/dtd.h @@ -17,7 +17,6 @@ #include #include -#include /* exit() */ #include "ws_attributes.h" typedef struct _dtd_build_data_t { diff --git a/epan/exntest.c b/epan/exntest.c index 0fe81645ed..0ae1afdd73 100644 --- a/epan/exntest.c +++ b/epan/exntest.c @@ -211,7 +211,7 @@ int main(void) except_init(); run_tests(); except_deinit(); - exit(failed?1:0); + return failed ? EXIT_FAILURE:EXIT_SUCCESS; } /* diff --git a/epan/tvbtest.c b/epan/tvbtest.c index add2380a56..84faca1995 100644 --- a/epan/tvbtest.c +++ b/epan/tvbtest.c @@ -817,7 +817,7 @@ main(void) varint_tests(); zstd_tests (); except_deinit(); - exit(failed?1:0); + return failed ? EXIT_FAILURE : EXIT_SUCCESS; } /* diff --git a/mmdbresolve.c b/mmdbresolve.c index 5669e89ea7..6fc64d2ee9 100644 --- a/mmdbresolve.c +++ b/mmdbresolve.c @@ -53,11 +53,6 @@ static const char **lookup_keys[] = { empty_key }; -static void exit_err(void) { - fprintf(stderr, "Usage: mmdbresolve -f db_file [-f db_file ...]\n"); - exit(1); -} - int main(int argc, char *argv[]) { @@ -110,7 +105,8 @@ main(int argc, char *argv[]) fflush(stdout); if (arg_idx != argc || mmdb_count < 1) { - exit_err(); + fprintf(stderr, "Usage: mmdbresolve -f db_file [-f db_file ...]\n"); + return EXIT_FAILURE; } int in_items = 0; @@ -186,7 +182,7 @@ main(int argc, char *argv[]) free(mmdbs); - return 0; + return EXIT_SUCCESS; } /*