From 6a2df7a6a363148eebaaf5e9d77ced76899dcd18 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 21 Oct 1996 04:37:06 +0000 Subject: Better errorb bailout in the UIDL handling. svn path=/trunk/; revision=360 --- pop3.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pop3.c b/pop3.c index 187deec8..e38e9c5d 100644 --- a/pop3.c +++ b/pop3.c @@ -162,14 +162,17 @@ int *countp, *newp; /* grab the mailbox's UID list */ *newp = 0; gen_send(socket, "UIDL"); - if ((ok = pop3_ok(socket, buf)) == 0) { - while (SockGets(socket, buf, sizeof(buf)) >= 0) { + if ((ok = pop3_ok(socket, buf)) != 0) + return(PS_ERROR); + else + { + while (SockGets(socket, buf, sizeof(buf)) >= 0) + { if (outlevel == O_VERBOSE) fprintf(stderr,"%s\n",buf); - if (strcmp(buf, ".") == 0) { + if (buf[0] == '.') break; - } - if (sscanf(buf, "%d %s", &num, id) == 2) + else if (sscanf(buf, "%d %s", &num, id) == 2) { save_uid(&queryctl->newsaved, num, id); if (!uid_in_list(&queryctl->oldsaved, id)) -- cgit v1.2.3