]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: log: add_to_logformat_list() used the wrong constants
authorWilly Tarreau <w@1wt.eu>
Thu, 20 Dec 2012 20:59:12 +0000 (21:59 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 20 Dec 2012 21:02:09 +0000 (22:02 +0100)
The <type> argument was checked against LOG_FMT_* but it was passed as
LF_* which are two independant enums. It happens that the 3 first entries
in these enums do match, but this broke some experimental changes which
required another state, so let's fix this now.

src/log.c

index 270fd571e86e63e7f64911ceaf0eceb01ffef611..0d63ba6aba1490b7927aae1bd93b9f4180338df5 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -302,7 +302,7 @@ void add_to_logformat_list(char *start, char *end, int type, struct list *list_f
 {
        char *str;
 
-       if (type == LOG_FMT_TEXT) { /* type text */
+       if (type == LF_TEXT) { /* type text */
                struct logformat_node *node = calloc(1, sizeof(struct logformat_node));
                str = calloc(end - start + 1, 1);
                strncpy(str, start, end - start);
@@ -310,7 +310,7 @@ void add_to_logformat_list(char *start, char *end, int type, struct list *list_f
                node->arg = str;
                node->type = LOG_FMT_TEXT; // type string
                LIST_ADDQ(list_format, &node->list);
-       } else if (type == LOG_FMT_SEPARATOR) {
+       } else if (type == LF_SEPARATOR) {
                struct logformat_node *node = calloc(1, sizeof(struct logformat_node));
                node->type = LOG_FMT_SEPARATOR;
                LIST_ADDQ(list_format, &node->list);