diff options
author | Phil Pennock <pdp@exim.org> | 2012-05-20 05:33:22 -0400 |
---|---|---|
committer | Phil Pennock <pdp@exim.org> | 2012-05-20 05:33:22 -0400 |
commit | 8c79eebfd4af6c2f480267b2396bbdf5592919a8 (patch) | |
tree | a6dca29cf7d87c6260b0ae409f802664203be27c /src | |
parent | c7c4ae90a7a7b9fc474e246e9a0d47ddf519117f (diff) |
GnuTLS debug callback: check for existing \n
Diffstat (limited to 'src')
-rw-r--r-- | src/src/tls-gnu.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/src/tls-gnu.c b/src/src/tls-gnu.c index 05a3e084c..51fdb8657 100644 --- a/src/src/tls-gnu.c +++ b/src/src/tls-gnu.c @@ -1183,7 +1183,14 @@ return TRUE; static void exim_gnutls_logger_cb(int level, const char *message) { - DEBUG(D_tls) debug_printf("GnuTLS<%d>: %s\n", level, message); + size_t len = strlen(message); + if (len < 1) + { + DEBUG(D_tls) debug_printf("GnuTLS<%d> empty debug message\n", level); + return; + } + DEBUG(D_tls) debug_printf("GnuTLS<%d>: %s%s", level, message, + message[len-1] == '\n' ? "" : "\n"); } #endif |