From 63315199c4d0893bf11e5892f417cc7eeda3ce93 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sat, 14 Jan 2017 11:01:58 -0500 Subject: [PATCH] Fix bug in IMAP debug output Garbage from previous response was sometimes displayed in debug output. --- src/imap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/imap.c b/src/imap.c index eae62ce..13a3b0b 100644 --- a/src/imap.c +++ b/src/imap.c @@ -117,10 +117,6 @@ get_packet: goto error; } - if (wmnotify_infos.debug) { - printf("%s", rx_buffer); - } - /* * Converting the last CRLF into a LF followed by a NULL termination * character. @@ -128,6 +124,10 @@ get_packet: rx_buffer[len - 2] = '\n'; rx_buffer[len - 1] = '\0'; + if (wmnotify_infos.debug) { + printf("%s", rx_buffer); + } + /* * Check the Server Completion Response returned by the IMAP4 server. * There are currently three Server Completion Responses codes: -- 2.20.1