- case 't':
- seconds = atoi(optarg);
- if (seconds >= 0)
- timeout = seconds;
- else
- fprintf(stderr, "invalid timeout value\n");
+ case 't': {
+ int r;
+
+ r = safe_atou(optarg, &timeout);
+ if (r < 0) {
+ fprintf(stderr, "Invalid timeout value '%s': %s\n",
+ optarg, strerror(-r));
+ exit(EXIT_FAILURE);
+ };