X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib-crypt%2Fpgpmicalg.c;h=ae16b11a4d7472c2bf326790038358f07b48c507;hb=79b870584c9a4fca6f6bf34b9b95dcff3b76dc29;hp=a2d89db150a41177549051dadd53821b68a52ea1;hpb=230399f9632c37b66c1c117a17e8327eae6b3235;p=apps%2Fmadmutt.git diff --git a/lib-crypt/pgpmicalg.c b/lib-crypt/pgpmicalg.c index a2d89db..ae16b11 100644 --- a/lib-crypt/pgpmicalg.c +++ b/lib-crypt/pgpmicalg.c @@ -11,25 +11,16 @@ * algorithm. */ -#if HAVE_CONFIG_H -# include "config.h" -#endif +#include + +#include +#include -#include "mutt.h" #include "handler.h" #include "pgp.h" #include "pgppacket.h" #include "charset.h" -#include -#include -#include -#include - -#include -#include - -#include static struct { short id; @@ -74,7 +65,7 @@ static void pgp_dearmor (FILE * in, FILE * out) /* find the beginning of ASCII armor */ while ((r = fgets (line, sizeof (line), in)) != NULL) { - if (!strncmp (line, "-----BEGIN", 10)) + if (!m_strncmp (line, "-----BEGIN", 10)) break; } if (r == NULL) { @@ -98,7 +89,7 @@ static void pgp_dearmor (FILE * in, FILE * out) /* find the checksum */ while ((r = fgets (line, sizeof (line), in)) != NULL) { - if (*line == '=' || !strncmp (line, "-----END", 8)) + if (*line == '=' || !m_strncmp (line, "-----END", 8)) break; } if (r == NULL) { @@ -146,15 +137,15 @@ static short pgp_find_hash (const char *fname) short rv = -1; - mutt_mktemp (tempfile); - if ((out = safe_fopen (tempfile, "w+")) == NULL) { - mutt_perror (tempfile); + out = m_tempfile (tempfile, sizeof(tempfile), NONULL(Tempdir), NULL); + if (!out) { + mutt_perror (_("Can't create temporary file")); goto bye; } unlink (tempfile); if ((in = fopen (fname, "r")) == NULL) { - mutt_perror (fname); + mutt_perror (_("Can't create temporary file")); goto bye; } @@ -167,8 +158,8 @@ static short pgp_find_hash (const char *fname) bye: - safe_fclose (&in); - safe_fclose (&out); + m_fclose(&in); + m_fclose(&out); pgp_release_packet (); return rv; }