small fixes, style and cosmetics.
authorPierre Habouzit <madcoder@debian.org>
Sat, 25 Nov 2006 00:10:19 +0000 (01:10 +0100)
committerPierre Habouzit <madcoder@debian.org>
Sat, 25 Nov 2006 00:10:19 +0000 (01:10 +0100)
lib-crypt/crypt.c

index 3ee7853..87c1b41 100644 (file)
@@ -122,10 +122,8 @@ int mutt_protect (HEADER * msg, char *keylist)
     }
 
     /* otherwise inline won't work...ask for revert */
     }
 
     /* 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.");
 
         != 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);
 
   }
     fputc (c, fp);
 
   }
-  fclose (fp);
 
   return 0;
 }
 
   return 0;
 }
@@ -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) {
     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
         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);
          }
         }
                           TYPE (signatures[i]), signatures[i]->subtype);
          }
         }
+        m_fclose(&tempfp);
       }
 
       mutt_unlink (tempfile);
       }
 
       mutt_unlink (tempfile);