port = atoi(argv[argc - 1]);
if (port <= 0 || port > 0xffff ) {
- print_usage(argv[0]);
- fprintf(stderr, "\ninvalid port: '%s'\n", argv[argc - 1]);
+ fprintf(stderr, "invalid port: '%s'\n", argv[argc - 1]);
return EXIT_FAILURE;
}
case 'd': {
global_log_level = atoi(optarg);
if (global_log_level < 0) {
- print_usage(argv[0]);
- fprintf(stderr, "\n-d positive number required: '%s'\n",
+ fprintf(stderr, "-d positive number required: '%s'\n",
optarg);
exit(EXIT_FAILURE);
}
|| strlen(position + 1) == 0
|| atoi(position + 1) <= 0
|| atoi(position + 1) > 0xffff) {
- print_usage(argv[0]);
- fprintf(stderr, "\ninvalid -p: '%s', format host:port\n",
- optarg);
+ fprintf(stderr, "invalid -p: '%s', format host:port\n",
+ optarg);
exit(EXIT_FAILURE);
}
}
case 't': {
if (atoi(optarg) <= 0) {
- print_usage(argv[0]);
- fprintf(stderr, "\n-t positive number required: '%s'\n",
+ fprintf(stderr, "-t positive number required: '%s'\n",
optarg);
exit(EXIT_FAILURE);
}
}
if (optind >= argc) {
- print_usage(argv[0]);
- fprintf(stderr, "\nport missing\n");
+ fprintf(stderr, "port missing\n");
exit(EXIT_FAILURE);
}
}