From: mortenp Date: Wed, 2 Jun 2004 21:34:32 +0000 (+1000) Subject: fixed fgets() loop X-Git-Tag: RELEASE_1_0_0~177 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8de46479efa4e883f0947dd68a09973f93ea2f26;p=thirdparty%2Fmlmmj.git fixed fgets() loop --- diff --git a/src/mail-functions.c b/src/mail-functions.c index f01505aa..cdfc1c53 100644 --- a/src/mail-functions.c +++ b/src/mail-functions.c @@ -121,6 +121,9 @@ int write_mailbody_from_file(int sockfd, FILE *infile) /* keep writing chunks of line (max WRITE_BUFSIZE) */ for(;;) { bufp = buf+1; + errno = 0; /* We must reset errno, otherwise we can't + * determine if we hit EOF or an error + * occurred */ if(!fgets(bufp, WRITE_BUFSIZE, infile)) { if (errno == EINTR) { continue;