aboutsummaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-02-18 02:35:30 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-02-18 02:35:30 +0000
commit6a1b0f83e980b788b15054cc7d3223a8d0ed83ab (patch)
tree73a317f8788d12ae2a97523678306e4e0528237e /socket.c
parent7592b0c0805429cb8d73ce52eec4da82ce36e4bb (diff)
downloadfetchmail-6a1b0f83e980b788b15054cc7d3223a8d0ed83ab.tar.gz
fetchmail-6a1b0f83e980b788b15054cc7d3223a8d0ed83ab.tar.bz2
fetchmail-6a1b0f83e980b788b15054cc7d3223a8d0ed83ab.zip
Janos Farkas's fixes.
svn path=/trunk/; revision=897
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/socket.c b/socket.c
index 6b2076e7..e5b9ba5c 100644
--- a/socket.c
+++ b/socket.c
@@ -118,7 +118,8 @@ char *SockGets(char *buf, int len, FILE *sockfp)
if (--len < 1)
return NULL;
do {
- if ((n = recv(fileno(sockfp), bp, len, MSG_PEEK)) == -1)
+ /* return value of 0 is EOF, < 0 is error */
+ if ((n = recv(fileno(sockfp), bp, len, MSG_PEEK)) <= 0)
return NULL;
if ((p = memchr(bp, '\n', n)) != NULL)
{