From: Tim Duesterhus Date: Sat, 5 Jun 2021 22:50:20 +0000 (+0200) Subject: CLEANUP: cfgparse: Remove duplication of `MAX_LINE_ARGS + 1` X-Git-Tag: v2.5-dev1~186 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b3168b34a9b8f1ba4a1e722a7613ee7fb850cf91;p=thirdparty%2Fhaproxy.git 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. --- 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 |