projects
/
haproxy-2.5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5c86620
)
CLEANUP: cfgparse: Remove duplication of `MAX_LINE_ARGS + 1`
author
Tim Duesterhus
<tim@bastelstu.be>
Sat, 5 Jun 2021 22:50:20 +0000
(
00:50
+0200)
committer
Willy Tarreau
<w@1wt.eu>
Tue, 8 Jun 2021 08:54:30 +0000
(10:54 +0200)
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
patch
|
blob
|
history
diff --git
a/src/cfgparse.c
b/src/cfgparse.c
index
b1274cd
..
fa2072a
100644
(file)
--- 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 |