From b3168b34a9b8f1ba4a1e722a7613ee7fb850cf91 Mon Sep 17 00:00:00 2001 From: Tim Duesterhus Date: Sun, 6 Jun 2021 00:50:20 +0200 Subject: [PATCH] CLEANUP: cfgparse: Remove duplication of `MAX_LINE_ARGS + 1` We can calculate the number of possible arguments based off the size of the `args` array. We should do so to prevent the two values from getting out of sync. --- src/cfgparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cfgparse.c b/src/cfgparse.c index b1274cdb80..fa2072a831 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -1961,7 +1961,7 @@ next_line: uint32_t err; char *errptr; - arg = MAX_LINE_ARGS + 1; + arg = sizeof(args) / sizeof(*args); outlen = outlinesize; err = parse_line(line, outline, &outlen, args, &arg, PARSE_OPT_ENV | PARSE_OPT_DQUOTE | PARSE_OPT_SQUOTE | -- 2.47.3