Skip to content
Snippets Groups Projects
Verified Commit 5a90597d authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

daemon/main: work around CI lint:c problem

parent 449851ff
Branches
Tags
1 merge request!701CI clang tools: 5.0 -> 7.0
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);
break;
case 'S':
array_push(args->fd_set, strtol(optarg, NULL, 10));
array_push(args->fd_set, strtol_10(optarg));
break;
case 'T':
array_push(args->tls_fd_set, strtol(optarg, NULL, 10));
array_push(args->tls_fd_set, strtol_10(optarg));
break;
case 'c':
args->config = optarg;
break;
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);
......
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