aboutsummaryrefslogtreecommitdiffstats
path: root/imap.c
diff options
context:
space:
mode:
Diffstat (limited to 'imap.c')
-rw-r--r--imap.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/imap.c b/imap.c
index 0b7dcd2f..7fbac659 100644
--- a/imap.c
+++ b/imap.c
@@ -27,6 +27,10 @@ int imap_ok (FILE *sockfp, char *argbuf)
do {
if (!fgets(buf, sizeof(buf), sockfp))
return(PS_SOCKET);
+ if (buf[strlen(buf)-1] == '\n')
+ buf[strlen(buf)-1] = '\0';
+ if (buf[strlen(buf)-1] == '\r')
+ buf[strlen(buf)-1] = '\r';
if (outlevel == O_VERBOSE)
error(0, 0, "IMAP< %s", buf);
@@ -122,6 +126,10 @@ static int imap_getsizes(FILE *sockfp, int count, int *sizes)
{
int num, size;
+ if (buf[strlen(buf)-1] == '\n')
+ buf[strlen(buf)-1] = '\0';
+ if (buf[strlen(buf)-1] == '\r')
+ buf[strlen(buf)-1] = '\r';
if (outlevel == O_VERBOSE)
error(0, 0, "IMAP< %s", buf);
if (strstr(buf, "OK"))