Fix bug in IMAP debug output
[dockapps/wmnotify.git] / src / imap.c
index eae62ce..13a3b0b 100644 (file)
@@ -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: