diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1996-11-06 04:03:49 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1996-11-06 04:03:49 +0000 |
commit | 238cf89924fe33f03ceea5e4997d2ba0776530d3 (patch) | |
tree | 7b31a64cb01e8c22fcbc5d02c4a60779f7bdc31a /pop3.c | |
parent | f7af7a861c301ac43600e2da965692233e877d4d (diff) | |
download | fetchmail-238cf89924fe33f03ceea5e4997d2ba0776530d3.tar.gz fetchmail-238cf89924fe33f03ceea5e4997d2ba0776530d3.tar.bz2 fetchmail-238cf89924fe33f03ceea5e4997d2ba0776530d3.zip |
Back out the attempt to use stdio.
svn path=/trunk/; revision=488
Diffstat (limited to 'pop3.c')
-rw-r--r-- | pop3.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -15,6 +15,7 @@ #include <stdlib.h> #endif +#include "socket.h" #include "fetchmail.h" #define PROTOCOL_ERROR {fputs("fetchmail: protocol error\n", stderr); return(PS_ERROR);} @@ -30,9 +31,9 @@ char *argbuf; char buf [POPBUFSIZE+1]; char *bufp; - if (fgets(buf, sizeof(buf), sockfp) != (char *)NULL) { + if (SockGets(buf, sizeof(buf), sockfp) >= 0) { if (outlevel == O_VERBOSE) - fprintf(stderr,"%s",buf); + fprintf(stderr,"%s\n",buf); bufp = buf; if (*bufp == '+' || *bufp == '-') @@ -170,7 +171,7 @@ int *countp, *newp; int num; *newp = 0; - while (fgets(buf, sizeof(buf), sockfp) != (char *)NULL) + while (SockGets(buf, sizeof(buf), sockfp) >= 0) { if (outlevel == O_VERBOSE) fprintf(stderr,"%s\n",buf); @@ -182,7 +183,6 @@ int *countp, *newp; if (!uid_in_list(&ctl->oldsaved, id)) (*newp)++; } - fseek(sockfp, 0L, SEEK_CUR); } } } @@ -205,7 +205,7 @@ int *sizes; { char buf [POPBUFSIZE+1]; - while (fgets(buf, sizeof(buf), sockfp) != (char *)NULL) + while (SockGets(buf, sizeof(buf), sockfp) >= 0) { int num, size; @@ -218,7 +218,6 @@ int *sizes; else sizes[num - 1] = -1; } - fseek(sockfp, 0L, SEEK_CUR); return(0); } |