[exim-cvs] GnuTLS debug callback: check for existing \n

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Exim Git Commits Mailing List
Ημερομηνία:  
Προς: exim-cvs
Αντικείμενο: [exim-cvs] GnuTLS debug callback: check for existing \n
Gitweb: http://git.exim.org/exim.git/commitdiff/8c79eebfd4af6c2f480267b2396bbdf5592919a8
Commit:     8c79eebfd4af6c2f480267b2396bbdf5592919a8
Parent:     c7c4ae90a7a7b9fc474e246e9a0d47ddf519117f
Author:     Phil Pennock <pdp@???>
AuthorDate: Sun May 20 05:33:22 2012 -0400
Committer:  Phil Pennock <pdp@???>
CommitDate: Sun May 20 05:33:22 2012 -0400


    GnuTLS debug callback: check for existing \n
---
 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 05a3e08..51fdb86 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