From: Tim Duesterhus <[email protected]>

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 286289ad7..46c7eeeeb 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -1961,7 +1961,7 @@ int readcfgfile(const char *file)
                        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.25.1


Reply via email to