From: Hugo Villeneuve Date: Sat, 14 Jan 2017 16:01:58 +0000 (-0500) Subject: Fix bug in IMAP debug output X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=63315199c4d0893bf11e5892f417cc7eeda3ce93;p=dockapps%2Fwmnotify.git Fix bug in IMAP debug output Garbage from previous response was sometimes displayed in debug output. --- 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: