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