projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix compilation warnings in hook.c
[apps/madmutt.git]
/
lib-crypt
/
pgpmicalg.c
diff --git
a/lib-crypt/pgpmicalg.c
b/lib-crypt/pgpmicalg.c
index
8fe6a5e
..
ae16b11
100644
(file)
--- a/
lib-crypt/pgpmicalg.c
+++ b/
lib-crypt/pgpmicalg.c
@@
-11,24
+11,16
@@
* algorithm.
*/
* algorithm.
*/
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include <lib-lib/lib-lib.h>
+
+#include <lib-mime/mime.h>
+#include <lib-ui/curses.h>
-#include "mutt.h"
#include "handler.h"
#include "pgp.h"
#include "pgppacket.h"
#include "charset.h"
#include "handler.h"
#include "pgp.h"
#include "pgppacket.h"
#include "charset.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-#include <lib-lib/file.h>
-
-#include <lib-mime/mime.h>
static struct {
short id;
static struct {
short id;
@@
-73,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) {
/* 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) {
break;
}
if (r == NULL) {
@@
-97,7
+89,7
@@
static void pgp_dearmor (FILE * in, FILE * out)
/* find the checksum */
while ((r = fgets (line, sizeof (line), in)) != 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) {
break;
}
if (r == NULL) {
@@
-112,7
+104,7
@@
static void pgp_dearmor (FILE * in, FILE * out)
return;
}
return;
}
- mutt_decode_base64 (&state, end - start, 0,
(iconv_t) - 1
);
+ mutt_decode_base64 (&state, end - start, 0,
MUTT_ICONV_ERROR
);
}
static short pgp_mic_from_packet (unsigned char *p, size_t len)
}
static short pgp_mic_from_packet (unsigned char *p, size_t len)
@@
-145,15
+137,15
@@
static short pgp_find_hash (const char *fname)
short rv = -1;
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) {
goto bye;
}
unlink (tempfile);
if ((in = fopen (fname, "r")) == NULL) {
- mutt_perror (
fname
);
+ mutt_perror (
_("Can't create temporary file")
);
goto bye;
}
goto bye;
}
@@
-166,8
+158,8
@@
static short pgp_find_hash (const char *fname)
bye:
bye:
-
safe_fclose
(&in);
-
safe_fclose
(&out);
+
m_fclose
(&in);
+
m_fclose
(&out);
pgp_release_packet ();
return rv;
}
pgp_release_packet ();
return rv;
}