diff --git a/src/common.c b/src/common.c
index 138b7678cf3767fc7c3a6f551e86842ac3176b84..5487b326fd34ac31eb8adfe20fa6971ecd0c4fec 100644 (file)
--- a/src/common.c
+++ b/src/common.c
if (status < 0)
return (status);
+ if (status == 0)
+ {
+ DBG ("Received EOF from fd %i. "
+ "Closing fd and returning error.",
+ fd);
+ close (fd);
+ return (-1);
+ }
+
assert (nleft >= status);
nleft = nleft - status;
ssize_t status;
ptr = (const char *) buf;
- nleft = buflen;
+ nleft = count;
while (nleft > 0)
{