]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: log-format: fix return code of function parse_logformat_var_args()
authorThierry FOURNIER / OZON.IO <thierry.fournier@ozon.io>
Tue, 22 Nov 2016 22:13:04 +0000 (23:13 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Nov 2016 17:54:26 +0000 (18:54 +0100)
This patch replace the successful return code from 0 to 1. The
error code is replaced from 1 to 0.

The return code of this function is actually unused, so this
patch cannot modify the behaviour.

src/log.c

index 3f2b011ea60f4d7fc5a0994db9788da8a72497c6..0fee934efcf6c984887ba017405e4579c7619353 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -286,7 +286,8 @@ int prepare_addrsource(struct logformat_node *node, struct proxy *curproxy)
 
 
 /*
- * Parse args in a logformat_var
+ * Parse args in a logformat_var. Returns 0 in error
+ * case, otherwise, it returns 1.
  */
 int parse_logformat_var_args(char *args, struct logformat_node *node)
 {
@@ -296,7 +297,7 @@ int parse_logformat_var_args(char *args, struct logformat_node *node)
        char *sp = NULL; // start pointer
 
        if (args == NULL)
-               return 1;
+               return 0;
 
        while (1) {
                if (*args == '\0')
@@ -332,7 +333,7 @@ int parse_logformat_var_args(char *args, struct logformat_node *node)
                }
                args++;
        }
-       return 0;
+       return 1;
 }
 
 /*