X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib-crypt%2Fpgpmicalg.c;h=0edbfeaa4c6ce5619cddb63907e1c64719a05420;hb=4956024f0d540c5dd689444113307fa7f9dd4067;hp=c070173227d19550bfd471f1ef1ab49787ad4a44;hpb=1ee89902de184a640c171ae3285bff6882a791bd;p=apps%2Fmadmutt.git diff --git a/lib-crypt/pgpmicalg.c b/lib-crypt/pgpmicalg.c index c070173..0edbfea 100644 --- a/lib-crypt/pgpmicalg.c +++ b/lib-crypt/pgpmicalg.c @@ -13,15 +13,14 @@ #include -#include "mutt.h" +#include +#include + #include "handler.h" #include "pgp.h" #include "pgppacket.h" #include "charset.h" -#include - -#include static struct { short id; @@ -66,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) { @@ -90,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) { @@ -138,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(MCore.tmpdir), 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; } @@ -159,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; }