remove exit() from simple main()

This commit is contained in:
Michael Mann 2025-04-21 12:17:28 -04:00
parent 45a753194d
commit f08a6507dd
5 changed files with 8 additions and 16 deletions

View File

@ -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;
}
}

View File

@ -17,7 +17,6 @@
#include <glib.h>
#include <stdbool.h>
#include <stdlib.h> /* exit() */
#include "ws_attributes.h"
typedef struct _dtd_build_data_t {

View File

@ -211,7 +211,7 @@ int main(void)
except_init();
run_tests();
except_deinit();
exit(failed?1:0);
return failed ? EXIT_FAILURE:EXIT_SUCCESS;
}
/*

View File

@ -817,7 +817,7 @@ main(void)
varint_tests();
zstd_tests ();
except_deinit();
exit(failed?1:0);
return failed ? EXIT_FAILURE : EXIT_SUCCESS;
}
/*

View File

@ -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;
}
/*