Commit 5a90597d authored by Vladimír Čunát's avatar Vladimír Čunát

daemon/main: work around CI lint:c problem

parent 449851ff
Pipeline #42284 canceled with stages
in 3 minutes and 43 seconds
......@@ -513,6 +513,14 @@ static void args_init(struct args *args)
args->quiet = false;
static long strtol_10(const char *s)
if (!s) abort();
/* ^^ This shouldn't ever happen. When getopt_long() returns an option
* character that has a mandatory parameter, optarg can't be NULL. */
return strtol(s, NULL, 10);
/** Process arguments into struct args.
* @return >=0 if main() should be exited immediately.
......@@ -546,17 +554,17 @@ static int parse_args(int argc, char **argv, struct args *args)
array_push(args->tls_set, optarg);
case 'S':
array_push(args->fd_set, strtol(optarg, NULL, 10));
array_push(args->fd_set, strtol_10(optarg));
case 'T':
array_push(args->tls_fd_set, strtol(optarg, NULL, 10));
array_push(args->tls_fd_set, strtol_10(optarg));
case 'c':
args->config = optarg;
case 'f':
args->interactive = false;
args->forks = strtol(optarg, NULL, 10);
args->forks = strtol_10(optarg);
if (args->forks <= 0) {
kr_log_error("[system] error '-f' requires a positive"
" number, not '%s'\n", optarg);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment