aboutsummaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/socket.c b/socket.c
index acb8686f..e7d40904 100644
--- a/socket.c
+++ b/socket.c
@@ -76,17 +76,21 @@ int socket;
char *buf;
int len;
{
+ int rdlen = 0;
+
while (--len)
{
if (SockInternalRead(socket, buf, 1) != 1)
return -1;
+ else
+ rdlen++;
if (*buf == '\n')
break;
if (*buf != '\r') /* remove all CRs */
buf++;
}
*buf = 0;
- return 0;
+ return rdlen;
}
int SockPuts(socket,buf)