]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: cfgparse: Fix calculation of position for PARSE_ERR_TOOMANY message
authorTim Duesterhus <tim@bastelstu.be>
Tue, 23 Jun 2020 16:56:10 +0000 (18:56 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 23 Jun 2020 17:03:20 +0000 (19:03 +0200)
The arguments are relative to the outline, not relative to the input line.

This patch fixes up commit 9e1758efbd68c8b1d27e17e2abe4444e110f3ebe which
is 2.2 only. No backport needed.

src/cfgparse.c

index 2dc70c84492530064b61c07ad1208316c460a6b3..93faf4565a0adfcaa539e6c366ddf59654f0485a 100644 (file)
@@ -1976,7 +1976,7 @@ next_line:
 
                        if (err & PARSE_ERR_TOOMANY) {
                                ha_alert("parsing [%s:%d]: too many words, truncating at word %d, position %ld: <%s>.\n",
-                                        file, linenum, MAX_LINE_ARGS, (long)(args[MAX_LINE_ARGS-1] - thisline + 1), args[MAX_LINE_ARGS-1]);
+                                        file, linenum, MAX_LINE_ARGS, (long)(args[MAX_LINE_ARGS-1] - outline + 1), args[MAX_LINE_ARGS-1]);
                                err_code |= ERR_ALERT | ERR_FATAL;
                                fatal++;
                                goto next_line;