#include <lib-lib/lib-lib.h>
-#include "mutt.h"
+#include <lib-mime/mime.h>
+#include <lib-ui/curses.h>
+
#include "handler.h"
#include "pgp.h"
#include "pgppacket.h"
#include "charset.h"
-#include <lib-ui/curses.h>
-
-#include <lib-mime/mime.h>
static struct {
short id;
/* 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) {
/* 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) {
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;
}
bye:
- safe_fclose (&in);
- safe_fclose (&out);
+ m_fclose(&in);
+ m_fclose(&out);
pgp_release_packet ();
return rv;
}