From: Arran Cudbard-Bell Date: Thu, 13 Apr 2017 17:27:35 +0000 (-0400) Subject: Hack to get our extended log fmt specified working for DEBUG() and friends X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=715af3db2c19cfa36af10bcb85715287dd12784b;p=thirdparty%2Ffreeradius-server.git Hack to get our extended log fmt specified working for DEBUG() and friends --- diff --git a/src/lib/util/log.c b/src/lib/util/log.c index 125a0c0adbc..da39d208bef 100644 --- a/src/lib/util/log.c +++ b/src/lib/util/log.c @@ -275,7 +275,16 @@ int fr_vlog(fr_log_t const *log, log_type_t type, char const *msg, va_list ap) } } - if (len < sizeof(buffer)) len += vsnprintf(buffer + len, sizeof(buffer) - len - 1, msg, ap); + if (len < sizeof(buffer)) { + char *tmp; + + /* + * Fixme - All this code should be reworked to use a dynamic buffer + */ + tmp = fr_vasprintf(NULL, msg, ap); + len += strlcpy(buffer + len, tmp, sizeof(buffer) - len); + talloc_free(tmp); + } /* * Filter out control chars and non UTF8 chars