fclose -> m_fclose
[apps/madmutt.git] / lib-crypt / crypt.c
index 3ee7853..dd2eb02 100644 (file)
@@ -122,10 +122,8 @@ int mutt_protect (HEADER * msg, char *keylist)
     }
 
     /* otherwise inline won't work...ask for revert */
-    if ((i =
-         query_quadoption (OPT_PGPMIMEAUTO,
-                           _
-                           ("Message can't be sent inline.  Revert to using PGP/MIME?")))
+    if ((i = query_quadoption(OPT_PGPMIMEAUTO,
+        _("Message can't be sent inline.  Revert to using PGP/MIME?")))
         != M_YES) {
       mutt_error _("Mail not sent.");
 
@@ -294,7 +292,6 @@ static int crypt_write_signed (BODY * a, STATE * s, FILE *fp)
     fputc (c, fp);
 
   }
-  fclose (fp);
 
   return 0;
 }
@@ -352,7 +349,7 @@ void crypt_extract_keys_from_messages (HEADER * h)
         if (Context->hdrs[Context->v2r[i]]->security & ENCRYPT &&
             !crypt_valid_passphrase (Context->hdrs[Context->v2r[i]]->
                                      security)) {
-          fclose (fpout);
+          m_fclose(&fpout);
           break;
         }
 
@@ -423,7 +420,7 @@ void crypt_extract_keys_from_messages (HEADER * h)
     }
   }
 
-  fclose (fpout);
+  m_fclose(&fpout);
   if (isendwin ())
     mutt_any_key_to_continue (NULL);
 
@@ -548,9 +545,8 @@ int mutt_signed_handler (BODY * a, STATE * s)
     if (sigcnt) {
       tempfp = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
       if (!tempfp) {
-            mutt_perror (tempfile);
-      }
-      else {
+          mutt_error(_("Could not create temporary file"));
+      } else {
         if (crypt_write_signed (a, s, tempfp) == 0) {
           for (i = 0; i < sigcnt; i++) {
             if (signatures[i]->type == TYPEAPPLICATION
@@ -576,6 +572,7 @@ int mutt_signed_handler (BODY * a, STATE * s)
                           TYPE (signatures[i]), signatures[i]->subtype);
          }
         }
+        m_fclose(&tempfp);
       }
 
       mutt_unlink (tempfile);