From: Willy Tarreau Date: Fri, 12 Oct 2012 17:48:16 +0000 (+0200) Subject: MINOR: log: make lf_text use a const char * X-Git-Tag: v1.5-dev13~154 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f65356a228cca8ebfc966b3d0eb28b6b72c94e5;p=thirdparty%2Fhaproxy.git MINOR: log: make lf_text use a const char * lf_text() should use a const char * otherwise it makes it more complex to use data coming from const strings. --- diff --git a/include/proto/log.h b/include/proto/log.h index 5adf6740e7..a6c59ffc48 100644 --- a/include/proto/log.h +++ b/include/proto/log.h @@ -122,7 +122,7 @@ int get_log_facility(const char *fac); * * Return the adress of the \0 character, or NULL on error */ -char *lf_text(char *dst, char *src, size_t size, struct logformat_node *node); +char *lf_text(char *dst, const char *src, size_t size, struct logformat_node *node); /* * Write a IP adress to the log string diff --git a/src/log.c b/src/log.c index ce1b2a6919..15ba27bfac 100644 --- a/src/log.c +++ b/src/log.c @@ -495,7 +495,7 @@ int get_log_facility(const char *fac) * * Return the adress of the \0 character, or NULL on error */ -char *lf_text(char *dst, char *src, size_t size, struct logformat_node *node) +char *lf_text(char *dst, const char *src, size_t size, struct logformat_node *node) { int n; @@ -820,7 +820,7 @@ int build_logline(struct session *s, char *dst, size_t maxsize, struct list *lis return 0; list_for_each_entry(tmp, list_format, list) { - char *src = NULL; + const char *src = NULL; switch (tmp->type) { case LOG_FMT_SEPARATOR: