]> granicus.if.org Git - neomutt/commitdiff
Adeotato points out that feof() only works after a read. So, we now
authorThomas Roessler <roessler@does-not-exist.org>
Fri, 28 Jan 2005 16:40:33 +0000 (16:40 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Fri, 28 Jan 2005 16:40:33 +0000 (16:40 +0000)
check for an unsuccessful fgetc().

pgp.c

diff --git a/pgp.c b/pgp.c
index 079014f08d6c79be1944e67bd73c628c5eacc4a8..8347ba4e2935c9443c6b88b51544865457dea4d4 100644 (file)
--- a/pgp.c
+++ b/pgp.c
@@ -797,8 +797,10 @@ BODY *pgp_decrypt_part (BODY *a, STATE *s, FILE *fpout, BODY *p)
   fflush (fpout);
   rewind (fpout);
   
-  if (feof (fpout))
+  if (fgetc (fpout) == EOF)
     return NULL;
+
+  rewind (fpout);
   
   if ((tattach = mutt_read_mime_header (fpout, 0)) != NULL)
   {