]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: log: make lf_text use a const char *
authorWilly Tarreau <w@1wt.eu>
Fri, 12 Oct 2012 17:48:16 +0000 (19:48 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 12 Oct 2012 18:30:51 +0000 (20:30 +0200)
lf_text() should use a const char * otherwise it makes it more complex
to use data coming from const strings.

include/proto/log.h
src/log.c

index 5adf6740e7b76b830bf503b37a7e9e21ba92b8bc..a6c59ffc4832c1fb533e8b9a41df6dc17c0770b6 100644 (file)
@@ -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
index ce1b2a6919f8584528497581946c9cd06ecbce04..15ba27bfac7d0d6475b66d7ace312ff427c3a23a 100644 (file)
--- 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: